Ajax with ASP.NET MVC Framework Preview 2

This is the updated version of the Nikhil’s excellent example on how to use Ajax with ASP.net MVC.

I commented all the changes made in the code and prefixed them with //emad. So just search for //emad and you will see all the changes I made… Here is a quick list of the changes I made to make this compile and run on MVC Preview 2:

  1. Removed the [ControllerAction] tags – they are no longer needed.
  2. Updated the Route Table creation in the global.asax.cs file to work with the new format
  3. Updated the Ajax framework project to use the new classes
    1. HttpContextBase instead of IHttpContext
    2. HttpRequestBased instead of IHttpRequest
    3. HttpResponseBase instead of IHttpResponse
  4. Updated the AjaxViewContext constructor to match ViewContext constructor
  5. Changed the web.config to work with the new version (copied and pasted from another preview 2 project)

Note: Test project was not updated and will not compile – sorry, I didn’t have time to do it.

Here is the updated code: tasklist.zip