AJAX Mode

Custom ASPX forms in AJAX mode

If you're developing a custom ASPX form in AJAX mode, do the following:

  1. In the <form runat="server"> element, add a ScriptManager at the beginning of the form and wrap all the form content in the contenttemplate of an UpdatePanel.

    📌 Example

    <form id="form1" name="form1" runat="server">
        <asp:scriptmanager id="ScriptManager1" runat="server"></asp:scriptmanager>
        <asp:updatepanel id="UpdatePanel1" runat="server">
            <contenttemplate>
                ... form content ...
            </contenttemplate>
        </asp:updatepanel>
    </form>
  2. Since standard FileUpload controls are not supported inside the UpdatePanel, use the custom WorkflowFileUpload user control for your attachment needs.

  3. Add the following line in the page constructor to prevent an issue that can occur when updating a row in a GridView:

     this.UseClientSideOptimization = false;

    You will see no difference at runtime, since all this does is prevent a postback when clicking the Update button and the validation fails. The UpdatePanel already prevents postback.

  4. Register the postback triggers either in the Page_Load event or directly in the ASPX page for each of your ASP.NET controls that perform a postback or submit to WorkflowGen.

    To do this in the Page_Load event:

     ScriptManager.GetCurrent(this).RegisterPostBackControl(MyControlID);      

    To do this in the ASPX page:

    1. Add a <Triggers> element to the UpdatePanel.

    2. Add a <asp:PostBackTrigger ControlID="MyControlID" /> element for each of the controls that requires a postback trigger.

Last updated