|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dropdownlist selected valueI'm trying to simply get the selected value from a dropdownlist but it only
returns the first item regardless of what you select. Dim SalutationSelected As Integer = CInt(Me.ddlSalutationList.SelectedItem.Value) Thanks KT wrote:
> I'm trying to simply get the selected value from a dropdownlist but it only Have you tried using the SelectedValue property? It does exist.> returns the first item regardless of what you select. > > Dim SalutationSelected As Integer = > CInt(Me.ddlSalutationList.SelectedItem.Value) > > Thanks The code you are using looks as though it should work but the Cint function isn't necessary. So long as the value is a valid numeric string it will cast automatically. The 'Me.' qualifier isn't necessary either. Hence the following should work: Dim SalutationSelected as Integer = ddlSalutationList.SelectedValue Hope that helps Phil Hall
client-side code
Populate DropDownList w/ GridView Header Text gridview column alignment How to add DataSource to a TreeView programmatically GridView Update doesnt seem to work Pass a unique key from a Gridview to other controls on page...HELP!! My Auto Incrementing NumberedLabel doesn't work after upgrading to ASP.NET 2.0 Need previous value after a DropDownList ListControl.SelectedIndexChanged Event Open a page from the expand/collapse button on treeview? Open a page from the expand/collapse button on treeview? |
|||||||||||||||||||||||