Yes, when you modify the querystring you are infact loading a new instance
of the page, and the current viewstate no longer exists.
Viewstate only exists during postback, and will not be available when the
page loads as new again.
Why are you modifying the querystring, are you trying to remember values?
What are you trying to viewstate, a datagrid, or some values to remember?
I imagine you are trying to remember variable values while viewstating your
data (like datagrids).
So, what you can do instead of changing the querystring, is session or
viewstate the variables you are trying to remember.
so if you have a string variable called StrVar, you can remember it like
this.
string StrVar = <some string value>;
to save it:
ViewState["StrVar"] = StrVar;
or
Session["StrVar"] = StrVar;
to retrieve it
StrVar = (string)ViewState["StrVar"];
or
StrVar = (string)Session["StrVar"];
HTH
"Chris Ashley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> My app seems to lose its viewstate completely when I modify the
> querystring. Anything I can do about this?
>
> Cheers,
>
> Chris
>
|