G
Guest
Hi,
would like to know whether I can use ViewState to pass variables from one
web page to another. I've been trying do this but all I managed to do is to
pass the variable to the target page but am unable to extract the variable
out to print on the page. The source of the target page reflects a ViewState
value being passed. My code is as below:
(On 1st page)
ViewState("name") = Name
Response.Redirect("targetpage.aspx")
(On targetpage.aspx)
Name: <% Response.Write(CStr(ViewState("name")))%>
(Source of targetpage.aspx)
<form name="_ct10" method="post" action="targetpage.aspx" id="_ct10">
<input type="hidden" name="__VIEWSTATE" value="some gibberish string" />
Anything wrong with my code or do I need to import additional namespace?
Rgds,
blurz
would like to know whether I can use ViewState to pass variables from one
web page to another. I've been trying do this but all I managed to do is to
pass the variable to the target page but am unable to extract the variable
out to print on the page. The source of the target page reflects a ViewState
value being passed. My code is as below:
(On 1st page)
ViewState("name") = Name
Response.Redirect("targetpage.aspx")
(On targetpage.aspx)
Name: <% Response.Write(CStr(ViewState("name")))%>
(Source of targetpage.aspx)
<form name="_ct10" method="post" action="targetpage.aspx" id="_ct10">
<input type="hidden" name="__VIEWSTATE" value="some gibberish string" />
Anything wrong with my code or do I need to import additional namespace?
Rgds,
blurz