Total Pageviews

Monday, June 14, 2010

Implementation of ASP.Net Post back on the Client side

Implementation of ASP.Net Post back on the Client side:

Post back is implemented with the use javascript in the client side. The HTML page generated for each .aspx page will have the action property of the form tag set to the same page. This makes the page to be posted on to itself. If we check the entry on the HTML file, it will look something like this.

form name="_ctl1" method="post" action="pagename.aspx?getparameter1=134" language="javascript" onsubmit="if (!ValidatorOnSubmit()) return false;" id="_ctl1"

Also, all the validation code that is written (Required Field Validation, Regular Expression validation etc.,) will all be processed at the client side using the .js(javascript) file present in the webserver_wwwroot/aspnet_client folder.

With this new ASP .Net model, even if the user wants to post the data to a different .aspx page, the web server will check for the runat='server' tag in the form tag and post the web form to the same .aspx page. A simple declaration as in the following code snippet will be enough to create such a web form.

form id="form1" runat="server"

form

No comments:

Post a Comment