Sunday, April 15, 2012

Javascript : doPostBack

_doPostback is the function used by javascript to submit the page to server.. This function accepts two arguments eventtarget, eventargument..

eventtarget is the control which caused the post back. Event Argument is the arguments that are passed while posting back the page. ASP.NET has two hidden fields in each form one called event target and another one as Event Argument. The values are assigned in this hidden text boxes based on the control which causes the post back.

ASP.NET process looks for the values in these hidden text boxes and find the relevant method to trigger upon post back.