Why Did I Wait This Long To MVC / Razor?

4 July 2012

Started doing work on a small piece of MVC / Razor today, and it's great, really really great - it's just such a nicer model than standard ASP.Net, and you get nice separation of concerns, and having done a bunch of WP7 / MVVM-ish work, it feels...right.

One thing I did come across was the need for cascading dropdowns - I ended up using this nice little jQuery plugin, which works as advertised (and I really love how easy it is to provide Ajax methods via MVC - just need a new action and the Json(object) serializes very easily). Just beware that by default, the plugin disables your secondary cascaded dropdown, which means that MVC won't run the validation on that field (so if it's a required field, it will pass the client-side validation since it's "disabled"). I just commented the appropriate lines in the .js, but maybe there's a nicer fix for this.

Tags: cascading dropdown, MVC, Razor

Add a Comment

No Comments