WeaKness Posted November 23, 2003 Posted November 23, 2003 ok i am sure this is something simple but for the life of me i just dont get it..... i need to get the vlaue of the drop down list, check to see if its the default value, if it is report the msg, if it isnt, set the current value to a session value. I have everything done but i figured to get the value it would be myRegionList.Value or selected.value or some such, i have tried them all and i just dont get it..... i must be dense....... please help <asp:DropDownList id="myRegionList" runat="server" Width="145px"> <asp:ListItem Value="noRegion" Selected="True">Select Region</asp:ListItem> <asp:ListItem Value="Vegas">Las Vegas</asp:ListItem> <asp:ListItem Value="Pocatella">Pocatella</asp:ListItem> </asp:DropDownList> and If myRegionList.Value = "noRegion" thanks alot, sorry if its really easy i am trying to learn .net as fast as i can on my own Quote
mr relaxo Posted November 23, 2003 Posted November 23, 2003 drop down lists dont have a "value" property. try: if myRegionList.selecteditem.text ="noRegion" Quote You can not get ye flask.
bungpeng Posted November 24, 2003 Posted November 24, 2003 No No No, there is different between 'text' and 'value', we should show 'text' to end user; but for saving record, we should use 'value'. We can use Quote cbo.SelectedItem.Value [/Quote] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.