# I cannot submit my form using AJAX

**URL:** <https://discuss.workflowgen.com/t/i-cannot-submit-my-form-using-ajax/166>\
**Category:** Visual Studio Web Forms\
**Created:** [January 31, 2015, 8:25am UTC](https://discuss.workflowgen.com/t/i-cannot-submit-my-form-using-ajax/166 "2015-01-31T08:25:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [January 31, 2015, 8:25am UTC](https://discuss.workflowgen.com/t/i-cannot-submit-my-form-using-ajax/166/1 "2015-01-31T08:25:02Z")

</div>

### Issue

When using the ASP.NET AJAX Toolkit in your web form, you might experience issues submitting your web form either by using the `SubmitButton` or by manually triggering `SubmitToWorkflow()`.

### Details

AJAX-type web forms will internally submit the event trigger without actually performing a postback if the .NET control is encapsulated by an AJAX `UpdatePanel`. When submitting a WorkflowGen form, you are leaving the form and returning the data to the WorkflowGen engine. This requires a real postback, so you must register both the **Submit** and **Save As Draft** buttons as postback triggers.

Postback triggers are also required for `WorkflowFileUpload` controls, and `GridView` controls that make use of the `CalendarPopup` control for one or more inputs.

You can register the postback triggers either in the `Page_Load` event or directly in the ASPX page.

**To do this in the `Page_Load` event:**

Add the following .NET code for each of the above controls:

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

```

**To do this in the ASPX page:**

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

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