Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...