Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to find control

0 views
Skip to first unread message

iHavAQuestion

unread,
Apr 29, 2008, 12:35:00 PM4/29/08
to
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.

Joe

unread,
Apr 29, 2008, 3:34:49 PM4/29/08
to
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;
}


On Apr 29, 9:35 am, iHavAQuestion


<iHavAQuest...@discussions.microsoft.com> wrote:
> 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.ToStr­ing()]]

0 new messages