Access hidden controls on ascx page

  • Thread starter Thread starter krallabandi
  • Start date Start date
K

krallabandi

I have a hidden control
<input id="FieldSortOrder" type="hidden" name="FieldSortOrder"
runat="server"> in a ascx page. I want to store some value in this
control in the code behind page.

FieldSortOrder.Value = "xyz"

I am getting compilation errors - 'FieldSortOrder' is not declared.

The same thing is working good on aspx. how can it be done on ascx?


Thanks.
 
Try putting a public property on the ASCX... and getting to it that way.


public string MyFSO
{
get { return this.FieldSortOrder.value; }
}


Then refer to it by the controlname//property name.

...
 
Back
Top