You can integrate C# code into every Web SQL expression. This can be either a C# expression or a command string.
To integrate a C# expression into a Web SQL expression, enclose it in double curly brackets, as in the example:
To integrate a C# expression into a Web SQL expression
format ("The database user is: {0}",
{{ _Connection.User.Display }} )
|
NOTE: More complex commands are also enclosed in double curly brackets. The return value of the embedded expression is labeled with the keyword @return. |
To integrate multiple C# expressions into a Web SQL expression
format ("User is: {0}",
{{ string display = _Connection.User.Display;
@return display; }} )
|
NOTE: The keyword @return must always be the last command in the embedded expression in this case. |
The following statistical member variables are defined in all classes that can be modified by code. You can use these to gain access to the execution environment.
Name | Type | Description |
---|---|---|
_UserSession | VI.WebDesigner.Runtime.IUserSession | User session |
_Form | VI.WebDesigner.Runtime.IForm | Form on which the code is executed |
_Module | VI.WebDesigner.Runtime.IModule | Module in which the code is executed. |
_Connection | VI.DB.IConnection | Actual database connection |
The generated Microsoft .NET Framework code creates a structure of ASP.NET controls. A local variable is defined for each control. The name of this variable corresponds to the identifier given to the Web Designer node.
The local variable can be accessed directly from within the same method.
Furthermore, all controls coming from the base class System.Web.UI.Control have an identifier (ID), which also corresponds to the Web Designer node identifier. This makes it easier to locate controls outside the visible range of the local variable.
Data values can be loaded from or changed in collections using C# code.
Local collections of a module or component are defined in the component's TableStore.
TableStore.GetTable("SomeCollection")
|
NOTE: Virtual collections must use a slightly different call. Virtual collections are member variable of the class and can be accessed directly from the C# code using their name. |
© 2023 One Identity LLC. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy