Click here to Skip to main content
15,907,395 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have three dropdowns Country,state,city with autopostback=true and one show button .
when I am selecting country dropdown, page is also loading everytime
i want to ristrict pageloade while selecting the dropdownlilsts.

How it is possible in asp.net

Please give me Your valueble suggetions
Posted
Comments
Avik Ghosh22 23-Feb-13 6:25am    
autopostback=FALSE;try this

1 solution

Hi Srinivasa,

Since you are using autopostback, page is supposed to load.

I understand, you want to load the state on country selection and then on state selection you want to list the cities.

Do it like this.

Keep autopost back true on country and state and turn auto postback off on city.

1) Put all three control in a single row and all three should be in an AJAX UpdatePanel. You will require scriptmanager to run ajax. For any number of AJAXs, 1 scriptmanager should work.
2) On country selection, on postback event, list the states. Keep track that country dropdown is not cleared.
3) Then on State selection, retain country value, state value and populate cities.

Now, you have not told what show button is supposed to do, but i guess on show button click, you want to load some details or another page or whatever.

So I guess you can use above selected dropdown values now.

Keep coding.
Thanks.
 
Share this answer
 

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