Refresh problem

S

sunny

I use javascript to modify the label. when I refresh the web page. I lost
the modification. How can I put it into ViewState or How can I know whether
it is a refresh or regular postback in code behind?

any idea?

Thanks


Sunny.
 
E

Eliyahu Goldin

Sunny,

If you modify the html presentation of an asp.net Label control, you need to
communicate the change to the server. You can use an <input type = "hidden">
for this. On server side you get the value from the hidden input and set the
label.

What does it have to do with differentiation between a refresh or regular
postback in code behind? It's another question. Browser refresh button
always repeats the last postback. On server side you can tell the difference
if you include a unique piece of data in the postback, for example a
timestamp. On the server you compare the timestamp that just came with the
one from the previous postback. If it's the same, it must be a refresh and
not an another postback.

Eliyahu
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top