Access hidden controls on ascx page

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.
 
S

sloan

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.

...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top