views:

51

answers:

1

I am using ASP.Net 3.5. I have fiiled dropdown list in javascript using ajax service but unable to get its selected value in button click event on server side.

A: 

Is it an asp.net server control or a select list generated by javascript? If it is a javascript generated HTML element, you will not be able to use the .NET syntax such as

Dim x as string = controlID.selectedValue

You would need to do this the "old fashioned" way

Dim x as string = Request.Form("controlID")

Edit: When I say ASP.NET control, that would look like

<asp:dropdownlist id="controlID" runat="Server"> <asp:listItem text="Some Value" value="1" /> </asp:dropdownlist>

and the HTML generated control would be <select id="controlID" name="controlID><option value=1>Some Value</option></select>

Tommy