IsPostBack

Discussion in 'ASP .Net' started by =?Utf-8?B?QWxleCBDLiBCYXJiZXJp?=, Jan 27, 2006.

  1. Why does the page "post back" in ASP.NET? What is this for?


    --
    Alex C. Barberi
    Chief Executive Officer
    VisionForce
    http://www.visionforceweb.com
     
    =?Utf-8?B?QWxleCBDLiBCYXJiZXJp?=, Jan 27, 2006
    #1
    1. Advertising

  2. "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).

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Alex C. Barberi" <> wrote in message news:...
    > Why does the page "post back" in ASP.NET? What is this for?
    >
    >
    > --
    > Alex C. Barberi
    > Chief Executive Officer
    > VisionForce
    > http://www.visionforceweb.com
    >
     
    Phillip Williams, Jan 27, 2006
    #2
    1. Advertising

  3. 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

    "Alex C. Barberi" wrote:

    > Why does the page "post back" in ASP.NET? What is this for?
    >
    >
    > --
    > Alex C. Barberi
    > Chief Executive Officer
    > VisionForce
    > http://www.visionforceweb.com
    >
     
    =?Utf-8?B?RG91ZyBTYWxvbW9u?=, Jan 27, 2006
    #3
  4. Thanks again, Phillip.

    --
    Alex C. Barberi
    Chief Executive Officer
    VisionForce
    http://www.visionforceweb.com



    "Phillip Williams" wrote:

    > "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).
    >
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "Alex C. Barberi" <> wrote in message news:...
    > > Why does the page "post back" in ASP.NET? What is this for?
    > >
    > >
    > > --
    > > Alex C. Barberi
    > > Chief Executive Officer
    > > VisionForce
    > > http://www.visionforceweb
     
    =?Utf-8?B?QWxleCBDLiBCYXJiZXJp?=, Jan 27, 2006
    #4
  5. Well the page seems to post back every time it loads; why is this?

    --
    Alex C. Barberi
    Chief Executive Officer
    VisionForce
    http://www.visionforceweb.com



    "Doug Salomon" wrote:

    > 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
    >
    > "Alex C. Barberi" wrote:
    >
    > > Why does the page "post back" in ASP.NET? What is this for?
    > >
    > >
    > > --
    > > Alex C. Barberi
    > > Chief Executive Officer
    > > VisionForce
    > > http://www.visionforceweb.com
    > >
     
    =?Utf-8?B?QWxleCBDLiBCYXJiZXJp?=, Jan 27, 2006
    #5
  6. 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?

    "Alex C. Barberi" wrote:

    > Well the page seems to post back every time it loads; why is this?
    >
    > --
    > Alex C. Barberi
    > Chief Executive Officer
    > VisionForce
    > http://www.visionforceweb.com
    >
    >
    >
    > "Doug Salomon" wrote:
    >
    > > 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
    > >
    > > "Alex C. Barberi" wrote:
    > >
    > > > Why does the page "post back" in ASP.NET? What is this for?
    > > >
    > > >
    > > > --
    > > > Alex C. Barberi
    > > > Chief Executive Officer
    > > > VisionForce
    > > > http://www.visionforceweb.com
    > > >
     
    =?Utf-8?B?RG91ZyBTYWxvbW9u?=, Jan 27, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Baulch
    Replies:
    1
    Views:
    989
    Nathan Baulch
    Jun 26, 2003
  2. suzy
    Replies:
    11
    Views:
    769
    Rajeev Soni
    Aug 6, 2003
  3. Matthew
    Replies:
    1
    Views:
    1,501
    Matthew
    Nov 12, 2003
  4. Boris Zakharin

    IsPostBack returns false

    Boris Zakharin, Nov 19, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    663
    Boris Zakharin
    Nov 19, 2003
  5. Joey
    Replies:
    2
    Views:
    4,051
Loading...

Share This Page