Step by Step: Upgrade KiGG 1.1 for use with MVC 1.0

Mar 24, 2009 at 10:51 PM

For 2 reasons: 1)My requirements for using KiGG are simple and version 2.0 seems overkill and 2) I'm runing XP with IIS 5 for development and although I can mostly get KiGG 2.0 running, there are still issues, so decided to stick with 1.1.

Here are the steps to get KiGG running on the MVC 1.0 release.  Disclaimer:  I just worked through googling as I went to "get it to work".  How I ended up patching the application may not be 'best' solution, but works. And most of the changes are minor anyways.

- Qualify full path 2 lines in UserController.cs"body = File.ReadAllText(file);" with "System.IO.File."

- Update all RenderView methods. Explained here: http://forums.asp.net/t/1298260.aspx

- After updating ReviewView to View(), you'll need to update three blank returns with "return View();" - It doesnt look like it ever reaches it any way, with a redirect happening right before.

Also, if you get a blank page after upgrading to latest MVC 1.0
 - check out: http://mikehadlow.blogspot.com/2008/05/mvc-framework-defaultaspx-routes-no.html
- Update code that references ViewData to ViewData.Model
- http://forums.asp.net/p/1335909/2692022.aspx#2692022

- Add this to web.config.
        <add namespace="System.Web.Mvc.Ajax"/>
        <add namespace="System.Web.Mvc.Html"/>
 - http://stackoverflow.com/questions/211493/aspnet-mvc-beta-1-where-is-htmlrenderpartial

- The ActionLink Generic method was taken out an put in the futures assembly. Download the dll and include in the project.
 http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471
 Include this namespace in web.config: <add namespace="Microsoft.Web.Mvc"/>
 - More about ActionLink issue here:http://geoffrey-vandiest.blogspot.com/2009/02/aspnet-mvc-rc1-actionlink-cannot-be.html

- Update line 5 in StoryListView.ascx to <% BaseStoryListData viewData = ViewData.Model; %>
 - Keep going thru and you'll find similar errors where you need to update ViewData to ViewData.Model

- Update line 41 or UserController.cs to make the 'bool rememberMe' nullable by adding a "?"
 - public ActionResult Login(string userName, string password, bool? rememberMe)
 - Not sure this is ideal solution, but then on line 66, you need to cast the bool? back to a regular bool.
  FormsAuthentication.SetAuthCookie(userName, (bool)rememberMe);
 - Dont forget to update line 6 of Json.aspx for ViewData.Model to get logins working smoothly
 - reference: http://cromwellhaus.com/blogs/ryanc/archive/2007/12/20/asp-net-mvc-checkbox-boolean-value-mapping.asp