I have a web user control in an aspx page.
I want to access a hidden field that is in the web user control.
To access a value from TextBox I do following in code behind of the aspx page:
string myText = Convert.ToString(h.Text);
How would I get the value from a hidden inputfield that is in the web user control?
If I try following:
HiddenField h = (HiddenField)ProjectSubjectAgeWUC1.FindControl("hidText");
Then I get following error: Unable to cast object of type 'System.Web.UI.HtmlControls.HtmlInputHidden' to type 'System.Web.UI.WebControls.HiddenField'.