MVC 自己创建URL 对象处理路径

var url = new UrlHelper(filterContext.RequestContext);

  var url = new UrlHelper(HttpContext.Current.Request.RequestContext); 

  url.Content(FormsAuthentication.LoginUrl) ;

 

 FormsAuthentication.LoginUrl='~/Login/Index'     

发布程序在虚拟目录下,css 中图片引用要用相对路径,页面中的图片或者请求地址则需要走MVC 路由,

posted @ 2016-04-12 11:00  米姐  阅读(392)  评论(0编辑  收藏  举报