its .net 2.0 here, not MVC, and im crap at asp forms :(.
So yeah, ive got a page with user controls on it. When i click on something in the page, i want to load the usercontrol based on a parameter from the page.
Problem is i cant do it.
In my page's FaultTree_Clicked, i get the value, then ive tried a variety of things:
I tried exposing a property on the child user control to set the value, which i set in FaultTree_Clicked, it gets forgotten.
I tried saving it to Session["mykey"], and loading Session["mykey"] in the control's Page_init... the value is blank.
I tried saving it to ViewState["mykey"], and loading ViewState["mykey"] in the control's Page_init... the value is blank.
EDIT: ok more specific info: Heres a cut down version of what the page(MyFault) looks like:
<form id="form" runat="server">
<div id="faulttree">
<asp:TreeView ID="FaultTree" ......>
</div>
<uc1:_DefectDetail ID="DefectDetail" runat="server" Visible="true" EnableViewState="true" />
</form>
And theres a method on the pages codebehind "FaultTree_SelectedNodeChanged()".
When that method is hit, I want to load/show the DefectDetail control. The DefectControl requires a faultid, which comes off the Tree, which i successfully get in the SelectedNodeChanged method. I cant get the faultid into the defect control.