开发者

Refreshing page problem

开发者 https://www.devze.com 2023-03-31 14:17 出处:网络
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.

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 for Countries, it should populate all other five dropdownlists.
  • When selectIndex changed for Priorities, it also populate all other five dropdownlists.
  • When selectIndex changed for Titles, it should populate PIssues, MIssues, and Documents.
  • When selectIndex changed for PIssues, it should populate MIssues, and Documents.
  • When selectIndex changed for MIssues, it should populate Documents.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消