Creating configuration pages

The configuration page is a SharePoint 2013 ASP.NET page, displayed as a dialog when the user displays the configuration for your workflow action from the Workflow designer.

The following diagram illustrates the contents of a configuration page:

A configuration page consists of, at a minimum, the following items:

If you use the Visual Studio 2012 template provided with the Nintex Workflow 2013 SDK, these items are automatically added to the configuration page included with the template. For more information about the Visual Studio 2012 templates, see Installing and using Visual Studio templates.

Page directive

The configuration page should be based off the SharePoint 2013 default master page, to ensure UI consistency across all dialogs, and to enable the SharePoint Ribbon functionality. Add the following Page directive to the very top of the markup for the configuration page, where <CodebehindFile> is set to the name of the codebehind file and <CodebehindClass> is the full name of the class in the codebehind file for the configuration page.

<%@ Page Language="C#" DynamicMasterPageFile="~masterurl/default.master" 
    AutoEventWireup="true" CodeBehind="<CodebehindFile>" EnableEventValidation="false"
    Inherits="<CodebehindClass>, $SharePoint.Project.AssemblyFullName$"  %>

Register directives

Several Register directives must be added to the configuration page, to provide the basic functionality needed to interact with configuration settings for the custom workflow action.

The following Register directives must be present in the configuration page:

<%-- Register directives required by Nintex Workflow 2013 --%>
<%@ Register TagPrefix="Nintex" Namespace="Nintex.Workflow.ServerControls" 
    Assembly="Nintex.Workflow.ServerControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=913f6bae0ca5ae12" %>
<%@ Register TagPrefix="Nintex" Namespace="Nintex.Workflow.ApplicationPages" 
    Assembly="Nintex.Workflow.ApplicationPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=913f6bae0ca5ae12" %>
<%@ Register TagPrefix="Nintex" TagName="ConfigurationPropertySection" src="~/_layouts/15/NintexWorkflow/ConfigurationPropertySection.ascx" %>
<%@ Register TagPrefix="Nintex" TagName="ConfigurationProperty" src="~/_layouts/15/NintexWorkflow/ConfigurationProperty.ascx" %>
<%@ Register TagPrefix="Nintex" TagName="DialogLoad" Src="~/_layouts/15/NintexWorkflow/DialogLoad.ascx" %>
<%@ Register TagPrefix="Nintex" TagName="DialogBody" Src="~/_layouts/15/NintexWorkflow/DialogBody.ascx" %>
<%-- Place additional Register directives after this comment. --%>

These Register directives are common to all configuration pages. The following list describes each directive:

Depending on the requirements of the configuration page and the custom workflow action, you can add Register directives to include other user controls provided by Nintex Workflow 2013. For more information about working with controls on a configuration page, see Working with controls.

Content controls

The configuration page must contain two Content controls, with the following values for the ID attribute:

The following ASP.NET code illustrates the implementation of the required content controls:

<asp:Content ID="ContentHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <%-- The DialogLoad control must be the first child of the Content control. --%>
    <Nintex:DialogLoad runat="server" />

    <%-- JavaScript functions for reading and writing configuration data. --%>
    <script type="text/javascript" language="javascript">
        function TPARetrieveConfig()
        {
            // Use this JavaScript function to retrieve configuration settings from
            // the configuration XML and set the values of the corresponding controls
            // on the configuration page.
        }

        function TPAWriteConfig()
        {
            // Use this JavaScript function to retrieve configuration settings from
            // controls on the configuration page and set the values of the 
            // corresponding elements in the configuration XML.

	        return true;
        }

        onLoadFunctions[onLoadFunctions.length] = function () {
            dialogSectionsArray["<%= MainControls1.ClientID %>"] = true;
        };
    </script>
</asp:Content>

<asp:Content ID="ContentBody" ContentPlaceHolderID="PlaceHolderMain" runat="Server">
    <Nintex:ConfigurationPropertySection runat="server" Id="MainControls1">
        <TemplateRowsArea>
            <%-- Place ConfigurationProperty controls here --%>
        </TemplateRowsArea>
    </Nintex:ConfigurationPropertySection>

    <%-- The DialogBody control must be the last child of the Content control. --%>    
    <Nintex:DialogBody runat="server" id="DialogBody">
    </Nintex:DialogBody>
</asp:Content>

At this point, you have all of the items needed to develop a configuration page. Additional steps are needed to display and interact with configuration settings, such as adding configuration property sections, template controls, server controls, and user controls to the configuration page, but those steps depend largely on the functionality of the custom workflow action. For more information about additional steps, see Working with controls.

See Also

Concepts

Configuration pages

Operations

Working with configuration pages

Reference

.NET Framework Reference