IsPostBack

P

Phillip Williams

"A Web application is stateless. A new instance of the Web page class is created each time the page is requested from the server. This would ordinarily mean that all information associated with the page and its controls would be lost with each round trip. "
http://msdn2.microsoft.com/en-us/library/ms178198.aspx

The Page.IsPostBack property would have a value of true if the a control on the page, e.g. a button or a dropdownlist, triggered an event to be processed on the server. By checking this value, the programmer can write code that handle this scenario different than if the page was not posted back (i.e. was first reached by the browser).
 
G

Guest

A postback occurs when the browser makes a type of request to the webserver.
This causes :
1. Data to be sent from the browser to the webserver.
2. Processing on the webserver.
3. A response from the webserver back to the browser (i.e. a new web page).

Lots of things like database access, and filesystem cannot happen directly
in the user's browser. Those things occur on the web server.

So, if you wanted a bit of text (like a username) to be pulled from a
database and written to the browser when your user clicked a button, you
would want the buton to cause a postback. During the postback your program
would be able to talk to the database, and put the value retrieved into the
new webpage to send back to the user.

Doug
 
G

Guest

It shouldn't post back every time it loads.

For instance:
The first time the user comes to the page is not a post back.
If you have a regular hypertext link on your page, pointing to itself, that
should also not cause a postback.

What situations have you fouind a postback occuring, where you did not
expect it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top