T
Tarun Mistry
Hi all, im attempting to use the ViewState instead of the hidden values
normally used in procedural web development, however i cant seem to get
anything to add into it or load correctly from it.
I am trying to navigate through 4 stages of my script and saving data as i
go along. Typically i would use hidden variables however as there are no
server controls for these built in, i presumed they shouldnt be used as I
have no way of setting there values programatically (i dont think anyway).
I have a custom user control, within it at some point i execute the
following:
ViewState.Add("temp", "testing");
Then within my main page the following returns null pointer errors:
string test2 = ViewState["temp"].toString();
I have tried loading the viewstate after the page is rendered (i.e. set the
viewstate, render the page, click a button and see if my data is saved when
it rendered again [refreshing the view state]). Again doesnt work, same
problem.
I would really appreciate a simple way of doing this that would
automatically flush the data once the user has left the page. i.e. caching
or sessions arent really what I am looking for.
Thanks for any help.
Taz
normally used in procedural web development, however i cant seem to get
anything to add into it or load correctly from it.
I am trying to navigate through 4 stages of my script and saving data as i
go along. Typically i would use hidden variables however as there are no
server controls for these built in, i presumed they shouldnt be used as I
have no way of setting there values programatically (i dont think anyway).
I have a custom user control, within it at some point i execute the
following:
ViewState.Add("temp", "testing");
Then within my main page the following returns null pointer errors:
string test2 = ViewState["temp"].toString();
I have tried loading the viewstate after the page is rendered (i.e. set the
viewstate, render the page, click a button and see if my data is saved when
it rendered again [refreshing the view state]). Again doesnt work, same
problem.
I would really appreciate a simple way of doing this that would
automatically flush the data once the user has left the page. i.e. caching
or sessions arent really what I am looking for.
Thanks for any help.
Taz