Refreshing page problem
I am just started to learn MVC, and I am using MVC3 with Razor View engine.
I have a view that has 6 cascading dropdownlists, say Countries
, Priorities
, Titles
, PIssues
, MIssues
, Documents
.
- When
selectIndex
changed forCountries
, it should populate all other five dropdownlists. - When
selectIndex
changed forPriorities
, it also populate all other five dropdownlists. - When
selectIndex
changed forTitles
, it should populatePIssues
,MIssues
, andDocuments
. - When
selectIndex
changed forPIssues
, it should populateMIssues
, andDocuments
. - When
selectIndex
changed forMIssues
, it should populateDocuments
.
I have tried many different approaches, but I alwasys end up with duplicated dropdownlists.
For instance, when I change selection for Countries
, six new dropdownlists were created besides the original six.
What's the best approach for a solution to problem like this?
Sor开发者_如何学JAVAry about the long description and no code. If I include the code, it'd be the whole project. I hope this is clear enough.
if you are coming from classic ASP.Net (webforms) like I was, you should know that MVC does not behave like webforms. MVC doesn't do servers side onClick events (please correct me if I'm wrong). You will probably have to load the values from ajax and a JSON results from your MVC controller.
精彩评论