Question Locked

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

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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.

2 replies

by ihsanps

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

This discussion is closed to new replies.