So we at GoodCore had to find some trigger that can post form data to save record into the database. I was using ImageButton due to design requirements. If you specify a value for the PostBackUrl property, the page does not post back to itself. In my case it had to specify one.
So this post is an effort to save your time.
Ok, let’s get started.
Here are few easy steps we will be doing to get this done: (can’t miss any of them)
2. PageMethods is something most of you might be familiar with or even heard of. We need to set “EnablePageMethods” to true in ScriptManager.
<asp:ScriptManager ID=”sm” runat=”server” EnablePageMethods=”true” />
3. Now we will define our server side method which actually does the trick, saving record in database in my case:
public static void CompleteOrder()
4. Finally, we need to add an attribute to our form; here my form id is “myform”: