设置过的人是知道的,发现运行起来路径是错误的,而mvc 的执行模式不同于WebPage , 现在正在搞这个问题,怎么样把设置的起始页取消,恢复mvc本身的执行过程!
------解决方案--------------------------------------------------------
HOMEPAGE
------解决方案--------------------------------------------------------
选中网站项目——Web——特定页
删除特定页中的内容,
MVC3删Web.config中的没用。
------解决方案--------------------------------------------------------
1没用过,你试试吧,
不过最好用3,MVC2和MVC3的差距都非常大,
mvc3一定是趋势,页面干净,没有一点多余代码,逻辑清晰。
------解决方案--------------------------------------------------------
在global中设置
- C# code
routes.MapRoute( "Main", // 路由名称 "Main/{id}", // 带有参数的 URL new { controller = "Home", action = "Main", id = UrlParameter.Optional } );
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------
起始页设置成Default.aspx,Page_Load里缺省的代码是:
string originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);