How to find control

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

Joe

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;
}
 

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

Forum statistics

Threads
473,813
Messages
2,569,696
Members
45,485
Latest member
TerrenceBo

Latest Threads

Top