A usercontrol and your page can both have the same named Viewstate item.
They will not collide, but they also will not be visible to each other.
What you can do is access the Page object's viewstate from the usercontrol.
Create a property (MyProperty) on your Page that returns/sets your
viewstate. Then in the usercontrol
Dim x as string = CType(Page, MyMasterPage).MyProperty
http://tinyurl.com/6vw5z
Greg
"Raed Sawalha" <ra*********@hotmail.com> wrote in message
news:Oi**************@TK2MSFTNGP15.phx.gbl...
Hi
I have created a usercontrol in which I save a value in viewstate like
this:
ViewState["myValue"]=value;
If I use the same key (ViewState["myValue"]=value;) in my master page,
does the framework recognize where the value comes from ? Or have I to set
ViewState["myValuefrommyusercontrol"]=value; and
ViewState["myValuefrommymasterpage"]=value; ?
Regards