I've spent a lot of time over the past few months on this. Here are my observations.
The good/easy
- Getting Webforms to call into MVC controllers
- It was remarkably easy to stand up a new MVC3 project and drop Webforms pages into it.
- I was able to move my <pages><controls></controls></pages> section into the /pages directory in a new web.config there
The dirty/difficult
this is what I did to address that
@if (System.Diagnostics.Debugger.IsAttached)
{
<script src="../../Scripts/Mvc3/jquery-1.7-vsdoc.js" type="text/javascript"></script> @* intellisense! *@
@Html.RelativeJavascript(Links.Scripts.Mvc3.jquery_1_7_js)
@Html.RelativeJavascript(Links.Scripts.Mvc3.jquery_unobtrusive_ajax_js)
}
else
{
@Html.RelativeJavascript(Links.Scripts.Mvc3.jquery_1_7_min_js)
@Html.RelativeJavascript(Links.Scripts.Mvc3.jquery_unobtrusive_ajax_min_js)
}
Recommendations:
- Use
T4MVC in ALL cases even if you are pure webforms. The elimination of magic strings for static content (.js,.css, images, specifying templates) is outstanding.