# Form designer: How to add custom code on the submitButton event in the ASP.NET server side code-behind?

**URL:** <https://discuss.workflowgen.com/t/form-designer-how-to-add-custom-code-on-the-submitbutton-event-in-the-asp-net-server-side-code-behind/247>\
**Category:** Form Designer\
**Created:** [July 27, 2013, 10:04pm UTC](https://discuss.workflowgen.com/t/form-designer-how-to-add-custom-code-on-the-submitbutton-event-in-the-asp-net-server-side-code-behind/247 "2013-07-27T22:04:32Z")\
**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:** [July 27, 2013, 10:04pm UTC](https://discuss.workflowgen.com/t/form-designer-how-to-add-custom-code-on-the-submitbutton-event-in-the-asp-net-server-side-code-behind/247/1 "2013-07-27T22:04:32Z")

</div>

```auto
// PageLoad 
protected void Page_Load(object sender, EventArgs e) 
{ 
    base.Page_Load(sender, e); 
    submitButton.Click += new EventHandler(MySubmitButton_Click); 
} 

protected void MySubmitButton_Click(object sender, EventArgs e) 
{ 
    // Your code... 
    // If you modify the form field's value then you have to call the 2 instructions below at the end.
    // this.SaveFormData(this.FormData, true); 
    // SubmitToWorkflow(); 
}

```

Note: This custom event will happen after the normal WorkflowPage submit event.
