I have found jQuery to be a great tool to simplify my MVC Views.
For example, instead of including complicated logic to add alternating styles to my tables I just do this...
$(document).ready(function() {
$("table.details tr:odd").addClass("detailsAlternatingRow");
$("table.details tr:even").addClass("detailsRow");
});
Do you know of any other good uses of jQuery to slim down the logic in my MVC View?
MVC Framework has a JsonResult that can be very nice to eliminate server round trips and might be able to get rid of some of the logic in your view page. I wrote a tutorial on this available at :
http://www.dev102.com/2008/08/19/jquery-and-the-aspnet-mvc-framework/
Implementing an observer http://google-ajax-examples.googlecode.com/svn/trunk/customevents/jquery.html proved a really good practise. Really nice for code maintenance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With