SidC SidC - 1 year ago 115
ASP.NET (C#) Question

Is it Possible to Convert MVC Web Project to Web Forms?

Good Morning,

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


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.

Joe Joe
Answer Source

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

 public static void RegisterRoutes(RouteCollection routes)

            // Classic URL mapping for IIS 6.0
                new { action = "Index", id = "" }

                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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download