Chat now with support
Chat mit Support

Identity Manager 8.2.1 - Web Designer Reference Guide

The Web Designer editor Web Designer structures and functions The Web Designer object model Working with the Web Designer Web project configuration options Customizing the Web Portal Basics of Web Designer programming Compiling and debugging Monitoring Frequent tasks in the Web Portal

Integrating C# code into a WebSQL Expression

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

  • Enter the expression in double curly brackets.

    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

  • Enter the expression in double curly brackets and use the keyword @return.

    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.

Access to environmental data

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 runtime environment.

Table 62: Member variables overview
Name Type Description
_UserSession VI.WebDesigner.Runtime.IUserSession User session
_Form VI.WebDesigner.Runtime.IForm Form on which the code is run
_Module VI.WebDesigner.Runtime.IModule Module in which the code is run.
_Connection VI.DB.IConnection Actual database connection

Referencing controls

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.

Referencing collections

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.

Example:

    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.

Verwandte Dokumente

The document was helpful.

Bewertung auswählen

I easily found the information I needed.

Bewertung auswählen