Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All Coders,

I am having 6 drop down on a aspx page, two boxed are bind at page_load() and the remaining drop downs will fill on selection of drop down values.

Pictorial representation

Now the issue is when I am selecting value from first drop down - > the second drop down is binding the data.
and when selecting value from 3rd drop down the values which selected in first and second are resetting to original.
------------
I tried following ways :
1) Kept drop down in update panel and tried, when selecting second drop down values the values from first drop down are resetting.

2)added trigger to update panel but facing same issue.
XML
<Triggers >
      <asp:AsyncPostBackTrigger ControlID ="dept" />
   </Triggers>


3) Added update panel to each drop down with trigger but same issue

How to achieve this functionality.
Please suggest...
Thanks in advance for your suggestions

-Avinash
Posted
Comments
Sibasisjena 13-Jan-15 4:56am    
Hi Avinas,

Have you written the codes inside the
if(!IsPostBack)
{

}
Avinash6474 13-Jan-15 4:57am    
Hi,
Yes I have this condition in code
Sibasisjena 13-Jan-15 5:01am    
i think, onchange of your 3rd dropdown first 2 dropdowns are bound again.
Avinash6474 13-Jan-15 5:15am    
Is there any way to preserve selected values?
Because if there is any other action(other than drop down selection) happening on page and page is geting postback then values from drop downs are getting initialized again. Losing selected values. :(
Sibasisjena 13-Jan-15 5:31am    
Please send me your .cs file. You can use gett to share files. You can upload the file there. And give me the link. Else you post your code here.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900