E
Eric Sullender
I'm not sure if I'm missing something here, or not approaching this
the right way, but here is my problem.
I have a page Page.aspx that contains a user control Control.ascx.
In the Page_Load of Page.aspx I have the following:
ViewState[ "param1" ] = "foo";
In Control.ascx I attempt to reference:
string newString = (string) ViewState[ "param1" ];
and the value is null. I set a breakpoint and did some debugging in
VS.NET and found that ViewState (in the control) is empty, but I can
reference Page.ViewState[ "param1" ] and see that it equals "foo".
However, if I try to reference Page.ViewState in the code the compiler
complains. Any ideas? All I'm really trying to do is set a variable
that controls can access.
the right way, but here is my problem.
I have a page Page.aspx that contains a user control Control.ascx.
In the Page_Load of Page.aspx I have the following:
ViewState[ "param1" ] = "foo";
In Control.ascx I attempt to reference:
string newString = (string) ViewState[ "param1" ];
and the value is null. I set a breakpoint and did some debugging in
VS.NET and found that ViewState (in the control) is empty, but I can
reference Page.ViewState[ "param1" ] and see that it equals "foo".
However, if I try to reference Page.ViewState in the code the compiler
complains. Any ideas? All I'm really trying to do is set a variable
that controls can access.