Accessing Controls in LoginView

S

Steve Harp

Hi All,

This should be easy. I have a LoginView control on my default page.
Within the LoggedInTemplate, I have a DropDownList control. From my
code-behind cs file (in the DropDownList_SelectedIndexChanged method),
how can I access the DropDownList to see what selection was made? A
small code snippet would be very helpful.

Thanks,
Steve
 
T

Teemu Keiski

If that event is already raised ok, and it is raised by the DropDownList you
want to access, just get it via sender argument e.g you have

protected void DropDownList1_selectedIndexChanged(object sender, EventArgs
e)
{
DropDownList list=(DropDownList)sender;
//Do something with the DDL
}

E.g in .NET object raising the event is always accessible via the sender
argument. Wiring event handlers with that signature is standard in .NET.
 

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,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top