Home All Groups Group Topic Archive Search About
Author
31 Jan 2005 2:08 AM
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.

Author
31 Jan 2005 9:43 AM
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

Show quoteHide quote
"sunny" <jksunn***@hotmail.com> wrote in message
news:%237KFWnzBFHA.3092@TK2MSFTNGP10.phx.gbl...
> 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.
>
>