Hi,
I am working on Asp.net mvc3
My view part
I have written following code to cascading dropdownlists
opulateStatesDropDown()
{
//code for populate statedropdowlist and it is working
}
$("#countryDropDown").val("@ViewBag.CountryID"); //This line is working
if ($("#countryDropDown").val() != null) {
PopulateStatesDropDown();
$("#stateDropDown").val("@ViewBag.StateID"); //This is not working
control Action
ViewBag.CountryID = Country.Id;
ViewBag.StateID = State.Id;
I have written above code for select default values and its working for Countrydropdownlist but its not working for statedropdownlist.
Can you tel me anyone where I have done mistake ?
Thank you in advance
Loading
Jignesh TrivediPosted Jan 12, 2012, 1:18 AM
sorry,
please rename extension
from zip to zipx and try.
raja rameshPosted Jan 12, 2012, 12:41 AM
Jignesh TrivediPosted Jan 11, 2012, 12:43 AM
Try Atteched code.
hope this help.