Dropdownlist & Ajax Chechboxlist

I am working on a project where i need to have a value selected from a dropdownlist which in turns calls an Ajax action to display checkboxlists

Say i have dropdownlist of countries. Once i select a country X, i get checkboxlist with the corresponding states of country X.

Thanks in advance

I got it to work, but now i have a prevailing issues when it comes to updating the same.

I need to be able to see the checkboxes that were previously checked when i am updating.

My setup works with one dropdownlist and checkboxes are dependent on the selected value from the dropdownlist. Say list of countries appears on the dropdownlist and states/cities are checkboxes dependent on the country selected.

how do i make sure that while updating i am able to see the checkboxes with the states or cities of the given country. Presently i have to select the country again from the dropdown to be able to see the checkboxlist.

thanks in advance