C# Functions
Using C# Functions
You can use both inline and external C# functions as any other CMS functions. You can insert them on pages or page templates. You can make function calls to them from, or use them in templates of, XSLT functions. You can use C# functions to set values of input parameters and data fields.
Please note that on pages you can use C# functions when switched to the Source view. To learn to make them available in Visual Editor, too, please see “Integrating with Visual Editor”.
To use a C# function on a page:
- In Content, select a page and click Edit Page.
- Switch to Source.
- Place the cursor where you want the function inserted.
- Click Insert > Function Markup.
- In the Select Function window, expand All Functions, namespaces, select the function and click OK.
- In the Function properties window, set the function’s parameters if required and click OK.
The function will appear on a page.
Figure 21: A C# function inserted on a page (Visual view)
In the same manner, you can insert C# function in page templates and XSLT functions.
Please also see “How to Use Functions“ in the “Guide to CMS Functions”.