> For the complete documentation index, see [llms.txt](https://docs.workflowgen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.workflowgen.com/vs-web-forms/ajax-mode.md).

# 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`.<br>

   📌 **Example**

   ```html
   <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.<br>
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.<br>
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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.workflowgen.com/vs-web-forms/ajax-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
