-
Postback in ASP.net
about 9 years ago
-
almost 10 years ago
Post back is a process of submitting an ASP.NET page data to the server for processing. In other words you can also say Post back is a mechanism that actually sending all the information from client to web server, then web server process all those contents and returns back to the client.
-
-
over 4 years ago
PostBack is the name given to the way toward presenting an ASP.NET page to the server for handling. PostBack is done if certain qualifications of the page are to be checked against certain sources, (for example, confirmation of username and secret word utilizing database). This is something that a customer machine can't achieve and hence these subtleties must be 'posted back' to the server.
A post back is round trip from the client (Browser) to the server and then back to the client. This enables you page to go through the asp engine on the server and any dynamic content to be updated.
Using Code
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″ >
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” >
<!– place the controls inside –>
</form> -
2 Answer(s)