views:

106

answers:

2

Good Morning,

Has anyone attempted to convert/migrate an ASP.net MVC web application project to ASP.net web forms? If so, how did you accomplish this?

Thanks, Sid

Clarification/Update: The server is running IIS6 and I've modified global.asax. I followed Phil Haack's instructions on setting up IIS6 for use by MVC. I can now view the site in browser at //localhost/domainname. However, it appears that the CSS file isn't being read as no styling is being applied. I'm able to click links to each of my pages except for Parts which gives me errors.
I'm new to MVC but not to webforms. My thought was that since I'm having difficulties/frustration implementing the MVC app that I would revert to webforms before I get too deep into the development process.

+4  A: 

A direct conversion? No.

It would take a lot of analyzation and extra work (figuring out how to work with ViewState, converting Controller logic and Views into WebParts, etc.) to convert a .NET MVC App to Web Forms but it could definitely be done.

Personally...I'd never switch back.

Justin Niessner
+1  A: 

I am running on IIS6 with no issues. Set your routes like this,

 public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            // Classic URL mapping for IIS 6.0
            routes.MapRoute(
                "Default",
                "{controller}.aspx/{action}/{id}",
                new { action = "Index", id = "" }
            );

            routes.MapRoute(
                "Root",
                "",
                new { controller = "Home", action = "Index", id = "" }
            );
        }

and for the CSS links I code it like this,

<link  href="../../Content/Site.css" rel="stylesheet" type="text/css" />

then for any script tags I use this,

<script src="<%=HttpRuntime.AppDomainAppVirtualPath %>/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

and it seems to work fine.

Joe