User Control Functions
Created by @burningice
How to implement
- In the code editor of your choice (for example, Visual Studio), create a user control under
~/App_Data/UserControl
. The folder structure is the same as for~/App_Data/Xslt
: folders become namespaces and filenames become function names. - If needed, add parameters as described below.
- Insert the User Control function as you insert regular CMS Functions (in Visual or Source Editor). Please note that in Orckestra CMS version 2.1.1, you can only insert User Control functions in Source mode.
Adding parameters
You can add parameters to User Control functions by declaring them as public properties. You can also specify the label, help text and the default value via the Function Parameter attribute:
Expand code
You can also specify the widget for the parameter by using the 'WidgetMarkup' as a parameter to the FunctionParameter attribute and setting it to the similar markup:
Expand code
Important Notes
- When inserting User Control functions on pages, please consider wrapping the page's markup with
<asp:form></asp:form>
as described in "Using asp:form" to avoid errors with user сontrols not being placed inside aform
tag withrunat=server
.