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.
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
> 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
[quoted text clipped - 5 lines]
>
> Sunny.