Home All Groups Group Topic Archive Search About
Author
22 Feb 2007 4:43 PM
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

Author
25 Feb 2007 8:18 PM
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.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net





Show quoteHide quote
"Steve Harp" <NoSpam@NoPlace.com> wrote in message
news:n0irt2dr6mft7tln6307be6cp2csbdv740@4ax.com...
> 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