Reputation: 58893
Is it possible to migrate an existing ASP.NET MVC3 project using the standard (webforms-like) template engine to Razor? How?
Thanks
Upvotes: 1
Views: 153
Reputation: 48240
It should be possible.
Rename your *.aspx
to *.cshtml
. Firstpay attention to control directives, for example
Inherits="System.Web.Mvc.ViewPage<MvcApplication1.Models.TheModel>
now becomes
@model MvcApplication1.Models.TheModel
Now examine your views carefully and replace all tags to razor-style tags (<% %>
-> @
)
Note that you don't have to migrate all your views - it's perfectly legal to mix the two view engines in a single MVC application so you can plan your migration over time.
Upvotes: 1