IspostBack question

K

Kevin

Hi guys,

I am entering some texts on textarea(HTML control)
on codebehind, I have IsPostBack on page_load function.
So first time IsPostBack is equal to TRUE when I submit the form, that's
fine.

However, I refreshed the page, I can see IsPostBack is still equal to TRUE,
but I want it to be FALSE
what should I do?
 
P

Peter Rilling

When you refresh, it is sending the same information that was sent on the
first submit. From the server's perspective, the user just clicked another
button.

You will have to implement something so that a refresh does not cause a
submit or that duplicate submits are ignored.
 
K

Kevin

How would you do that then? I'm a newbie and I need help.
at least you can give me some more hints?

is there something like

if (Page.Refresh== true) then ignore everything?
 
K

Kevin

wow... This is cool!
Although I still prefer to write the codes by myself, I guess if I can't
figure it out then I 'll use this.

if you guys know what methods I can use to prevent refresh, then it would be
great. I don't want to use Javascript to prevent refresh.
One question, when you refresh the page, will sessionID 's value change?
Can I compare sessionId to find out whether page is refresh or not?
 
N

Nathan Sokalski

SessionID does not change unless the browser is closed and then opened
again. Since this obviously means the person has left the site, no, you
cannot compare SessionID to detect a refresh. SessionID is primarily used by
the server to remember who is who.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top