Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   how to get selected value from dropdown list (http://www.velocityreviews.com/forums/t98693-how-to-get-selected-value-from-dropdown-list.html)

Andy Sutorius 03-15-2005 10:34 PM

how to get selected value from dropdown list
 
Hi,

I created a web user control, a dropdown list of countries which binds to a
select statement. I have placed that control in 2 different locations within
the same form, but in different panels. When the page loads the control
binds and displays perfectly. How do I get the selected value of each drop
down?

Thanks,

Andy



Brock Allen 03-15-2005 10:57 PM

Re: how to get selected value from dropdown list
 
Is DropDownList.SelectedValue what you're looking for?

-Brock
DevelopMentor
http://staff.develop.com/ballen



> Hi,
>
> I created a web user control, a dropdown list of countries which binds
> to a select statement. I have placed that control in 2 different
> locations within the same form, but in different panels. When the page
> loads the control binds and displays perfectly. How do I get the
> selected value of each drop down?
>
> Thanks,
>
> Andy
>





Scott M. 03-15-2005 11:00 PM

Re: how to get selected value from dropdown list
 
lstDropDown.SelectedItem.Text or
lstDropDown.SelectedItem.Value


"Andy Sutorius" <andy@sutorius.com> wrote in message
news:ZpJZd.27117$wl4.722475@twister.southeast.rr.c om...
> Hi,
>
> I created a web user control, a dropdown list of countries which binds to
> a
> select statement. I have placed that control in 2 different locations
> within
> the same form, but in different panels. When the page loads the control
> binds and displays perfectly. How do I get the selected value of each drop
> down?
>
> Thanks,
>
> Andy
>
>




Andy Sutorius 03-15-2005 11:08 PM

Re: how to get selected value from dropdown list
 
It's a web user control and there are 2 of them. It's not that simple is it?


"Scott M." <NoSpam@NoSpam.com> wrote in message
news:uhMCGKbKFHA.3340@TK2MSFTNGP14.phx.gbl...
> lstDropDown.SelectedItem.Text or
> lstDropDown.SelectedItem.Value




Scott M. 03-16-2005 12:37 AM

Re: how to get selected value from dropdown list
 
Why should it be any harder than this?


"Andy Sutorius" <andy@sutorius.com> wrote in message
news:UVJZd.27209$wl4.724969@twister.southeast.rr.c om...
> It's a web user control and there are 2 of them. It's not that simple is
> it?
>
>
> "Scott M." <NoSpam@NoSpam.com> wrote in message
> news:uhMCGKbKFHA.3340@TK2MSFTNGP14.phx.gbl...
>> lstDropDown.SelectedItem.Text or
>> lstDropDown.SelectedItem.Value

>
>




faniccj 02-11-2011 06:39 AM

Hello. i have a dropdown list, its asp.net control
Code:

<asp:DropDownList ID="searchdroplist" runat="server"
        onselectedindexchanged="searchdroplist_SelectedIndexChanged">
        <asp:ListItem Value = "n" Selected="False">Search By Name</asp:ListItem>
        <asp:ListItem Value = "r">Search By Roll#</asp:ListItem>
    </asp:DropDownList>

i have two lables and i want to show a lable mean lable.visible = true; on a specific list item selected.
i m writing
Code:

if (searchdroplist.SelectedItem.Value == "n") {

                namelbl.Visible = true;
}

but its not working for me. what is the mistake in this code?

raouf2me 10-29-2012 08:14 PM

You should set the property AutoPostBack a true


All times are GMT. The time now is 03:28 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.