The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: Cascading DropDown List in ASP.NET MVC 2 using JQuery
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

den kkkddPosted Dec 13, 2012, 12:32 PM
Thank you very much!!!
Arun PonnusamyPosted Oct 25, 2012, 11:53 AM
HI Can you give an example for 3 level cascading when i try for an another level it is giving error in creating the instance Ex I am trying to cascade Degree, Year, Semester I could do the Degree and Year but I am struck with the semester Thanks
mahalakshmi sethuPosted Oct 11, 2012, 7:14 AM
Thank you so much!
chrisPosted Jun 4, 2011, 12:08 PM
Kumar; Nice work, and easy to understand and implement. Could you extend it to 4 cascading dropdown lists with MVC2(or MVC3 preferrably) using JQuery. That is: State City Street Name House Number. It will be a wonderful program. I look forward to your reaction to this. ChrisWan [email protected]
chrisPosted Jun 4, 2011, 12:04 PM
Kumar; Nice work, and easy to understand and implement. Could you extend it to 4 cascading dropdown lists with MVC2(or MVC3 preferrably) using JQuery. That is: State City Street Name House Number. It will be a wonderful program. I look forward to your reaction to this. Chris Wan
VickyPosted May 24, 2011, 4:25 PM
Hi Kumar, Thank you in advance for your great work. I am trying ti implement the cascading ddl on my project but I´m facing a problem. Lets say i want to store the StateID(GUID) instead of the State name(which is a string). When i try to select the SelectListItems select new SelectListItem { Text = State .Name, Value = State .Id.ToString(), } I get the error " not supported exception was unhandled by user code - LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression." Is there a solution to figure this problem?
Nicolas MijochPosted May 3, 2011, 6:48 PM
$.getJSON(url, { Sel_StateName: $(ddlsource).val() }, function (data) { $(ddltarget).empty(); $.each(data, function (index, optionData) { $(ddltarget).append("<option value='" + optionData.Text + "'>" + optionData.Value + "</option>"); }); In this part in the jquery function you have conceptually error, you put <option value='" + optionData.Text + "'> instead <option value='" + optionData.Value + "'> and the next part is the same. In your program works, because both data are the same. Despite this little error your post help me a lot. Thanks for share it with the world!.
sebastian herreraPosted Apr 22, 2011, 1:59 AM
Hi Kumar, thanks in advance for your work. it helps me a lot. I´m facing a doubt, what do I have to do in order to submit only the last value result to the database. Let me explain further: 1 - Product Table has a field CategoryId 2- Category Table has ParentCategoryId field that defines if a new dropdown appears with values. 3- When submit I send to the database the CategoryId of the last dropdown. Some categories display only one dropdownlist field based on the fact they dont have nested categories, consequently the id value goes directly to the database. Other categories have one dropdownlist for main category, another one for nested categories, if I send only the information of the first dropdown will not reflect the correct category detail. Any help will be appreciated. brgds. sa
vikas guptaPosted Apr 8, 2011, 10:05 AM
Hi Saurabh.. it is based on dropdown selected text..how can i do that on selected value(id of int) based.. please reply...
Paulo Crespo PereiraPosted Mar 8, 2011, 9:50 AM
You were very happy in your article. Congratulations! Simple, efficient and easy to learn. You are the man !
Nhung LuuPosted Mar 3, 2011, 9:32 PM
Hi ^^, Here, i don't known get the dropdownlist selected value when action sumit to Form Can you help me? Thanks you
SapnaPosted Feb 21, 2011, 10:59 PM
Very nice and easy to understand!