Search code examples
ruby-on-railsasp.net-mvcajaxasp.net-ajaxrjs

ASP.NET MVC AjaxHelpers recommended usage


It seems all the examples I come across specifiy an UpdateTargetId to render out the HTML content of the Ajax response. This is quite a bit different than how it's done in the Rails world, where the response content contains JavaScript code which manipulates the page. The Rails convention seems more powerful.

What's the recommended usage that makes the ASP.NET MVC approach powerful? What are its advantages?


Solution

  • There's no equivalent of Rails RJS generators in ASP.NET MVC though it might be implemented. So out-of-the box the Rails convention is more powerful, but IMHO it is questionable if returning Javascript from asynchronous actions is a good thing (Json and Xml are prefered).