Question

Locked

How can i get the values of a dropdown list which is populated using AJAX

By smart_am80 ·
Hi,

I have a gridview in which there are 5 template columns each containing a dropdownlist. When the aspx page is loaded first three of the dropdownlist are populated from database. Then I have onchange() javascript event on each of the first three dropdownlist. when user selects all of the first three values, then using ajax i populate the fourth and fifth dropdown list. Now my problem is that when user selects values for all the dropdownlists, then after clicking on submit button i have to write all selected values in some xml file. But i am not able to retrieve the values of the dropdownlist which is populated using ajax in code behind. Any help would be appreciated. Thanks in advance.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Getting the selected value of dropdownlist

by ihsanps In reply to How can i get the values ...

HI,

Inside the GridView1_RowUpdating method you need to use the follwing line of code to get the value of dropdownlist

Dim strvalue As String = DirectCast(GridView1.Rows(e.RowIndex).FindControl("nameofdropdownlist"), DropDownList).SelectedValue

Best Regards
Ihsan

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums