Last post Sep 06, 2009 11:02 PM by longvan_dmit
Jul 29, 2007 05:17 AM|lalaf|LINK
I have 2 dynamically created ddls in which the second ddl populates based on the first ddl and the values of both come from a database. These ddls are inserted into a table that is dynamically generated based on some event. My problem is that everytime I
select a value in the first ddl, the page load event is called and I lose the table. Is there a way to NOT call the page load on a selection? Or is there a way to generate the table with the values of ddls as soon as the page loads. I tried to fix this problem
with both using dynamic ddls and static ones. The same problem persists. Any help is appreciated.
Jul 29, 2007 09:52 AM|Ken Tucker|LINK
Make sure you are not filling the first dropdown when the page posts back.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
If DropDownList1.SelectedValue = "1" Then
ElseIf DropDownList1.SelectedValue = "2" Then
The cascading drop down control in the ajax toolkit is a good option.
Jul 30, 2007 02:35 AM|lalaf|LINK
I tried the exact same thing, but it did not work. Still, when I select an option from the first ddl, the entire page reloads. I made sure my function is exactly like yours with me.pageload and handles me.load, yet the page loads on a click of a dropdownlist.
Is that just the property of the ddl that can not be altered and I need to find a way around it?
Jul 30, 2007 03:13 AM|lalaf|LINK
I fixed this bu using panels. Instead of creating tables dynamically, I hard coded all of them and put them in panels and what you said works for panels. Thanks a lot for your help! :)
Sep 06, 2009 11:02 PM|longvan_dmit|LINK
I encounter with similar problem. But now I have big problem when I use master page and add one dynamic control. On that control contain 2 ddl and my problem is I can not get value from ddl. When I selected first ddl then I want to get value from second
ddl after populate value from first ddl. And when I click on button for submit so I can't get value from second ddl. I already know it poskback so I don't know how to solve this problem. Who can hepl me solve this problem, thanks all!
add items dynamically to my dropdownlist box webserver control