Postback is TRUE on refresh?!

P

Paul W

For debugging purposes, I have the following in Page_load:
Response.Write("postback is " + IsPostBack.ToString + Now.ToLongTimeString)
i



When I view my page in IE, if I hit F5 (refresh), it tells me (as expected)
that IsPostback is False.

If I then hit a submit button on the page it tells me (as expected) that
IsPostBack is true.

However, if I then hit F5 again, it tells me that IsPostBack is TRUE! How
come? (I know that its going back to the server (on not client cache)
because the displayed time changes).

Thanks,

Paul.
 
P

Patrice

F5 repeats the last HTTP request.
If it was a GET it issues a GET, if it was a POST it issues a POST
(PostBack)...

Patrice
 
C

Chris Simmons

For debugging purposes, I have the following in Page_load:
Response.Write("postback is " + IsPostBack.ToString + Now.ToLongTimeString)
i



When I view my page in IE, if I hit F5 (refresh), it tells me (as expected)
that IsPostback is False.

If I then hit a submit button on the page it tells me (as expected) that
IsPostBack is true.

However, if I then hit F5 again, it tells me that IsPostBack is TRUE! How
come? (I know that its going back to the server (on not client cache)
because the displayed time changes).

Thanks,

Paul.

Because you are technically posting the form again with that refresh.
Does the browser not ask you if you want to resubmit the data?
 
P

Paul W

Yes, the browser DOES ask me if I want to resubmit the data. Does this mean
that it SHOULD be received as a PostBack or should NOT.

Thanks,

Paul.
 
C

Chris Simmons

Yes, the browser DOES ask me if I want to resubmit the data. Does this mean
that it SHOULD be received as a PostBack or should NOT.

Thanks,

Paul.

Chris Simmons said:
Because you are technically posting the form again with that refresh.
Does the browser not ask you if you want to resubmit the data?

Paul, sorry for the delay here. That request from the browser is it
asking you if you want to re-post the data. So yes, you are reposting
("posting back") and the behavior you are seeing is to be expected.
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top