AdventuresWith.Net | Dann Blackwell

TAG | asp mvc

Mar/10

30

Converting MVC 2 RC to MVC 2 RTM

Ok, this is more of a hack than a true conversion, but I haven’t noticed the difference… yet.

Remember to back up what you’re not willing to lose!

  1. Remove your MVC project from your solution. Don’t delete, just remove. Then save all (Shift-Ctrl-S)
  2. Edit your MVC project *.csproj file and change the ProjectTypeGuids to:
    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>image
  3. Add your project back into your solution and save everything

,

A handy list of ActionResult’s that I found on StackOverflow thanks to Chris.S and his reference to the MSDN doc.

ContentResult
Writes a string value directly into the HTTP response.

EmptyResult
Does not write to the HTTP response.

FileContentResult
Takes the contents of a file (represented as an array of bytes) and write the contents into the HTTP response.

FilePathResult
Takes the contents of a file at the given location and writes the contents into the HTTP response.

FileStreamResult
Takes a file stream produced by the controller and writes the stream into the HTTP response.

HttpUnauthorizedResult
A special result used by authorization filters when authorization checks fail.

JavaScriptResult
Responds to the client with a script for the client to execute.

JsonResult
Responds to the client with data in JavaScript Object Notation (JSON).

RedirectResult
Redirects the client to a new URL.

RedirectToRouteResult
Renders the specified view to respond with an HTML fragment (typically used in AJAX scenarios).

PartialViewResult
Renders the specified view to respond with an HTML fragment (typically used in AJAX scenarios).

ViewResult
Renders the specified view and responds to the client with HTML.