How to find control

  • Thread starter Thread starter iHavAQuestion
  • Start date Start date
I

iHavAQuestion

I am using a menu control in which i have a tab controld in which i have a
dropdownlilst

How do i find the values in a control.

I have tried this in C#
?LTCMenu1.FindControl[Tab2.FindControl[ddlStatusVerify.DataValueField.ToString()]]


Can any one plz help me out.
 
Control.FindControl returns a Control Object.

you have to cast that control as the type you expect. In this case a
DropdownList. Then you can access the DataValueField Member.

Control c = new Control();
DropDownList ddl = (DropDownList)c.FindControl("id");
if (ddl != null)
{
string value = ddl.DataValueField;
}
 
Back
Top