The hidden control is initialized automatically by the ASP.NET page parser. Basically, this:
<INPUT type="hidden" id="Hidden1" name="Hidden1" runat="server">
is what creates a new instance of the control.
In your page code you don't have a markup instance of the USER control because you are attempting to create one in the code behind. So you instantiate an instance of the control's code behind class. HOWEVER! Because of that (note what I said above) there is no instance of the hidden input control because the markup part of the control (the ASCX file) is never parsed. There is no technical reason why you can't create an instance of the code-behind class, it just doesn't work that way. Instead you need to use the Page.LoadControl() method:
WebUserControl1 usr_ctrl;
usr_ctrl = (WebUserControl1)LoadControl("WebUserControl1.ascx ");
This makes the process actual load your user control markup file, not just the class defined in the codebehind file.
-
Peter