ASP.NET MVC 请求路径相关参数的获取

 

Request.ApplicationPath /
Request.CurrentExecutionFilePath /Home/Index
Request.FilePath /Home/Index
Request.Path /Home/Index
Request.PhysicalApplicationPath E:\VS_Project\WorkOrder\WorkOrder.Web\
Request.PhysicalPath E:\VS_Project\WorkOrder\WorkOrder.Web\Home\Index
Request.RawUrl /Home/Index?ID=0
Request.Url http://localhost:63287/Home/Index?ID=0
Request.Url.AbsolutePath /Home/Index
Request.Url.AbsoluteUri http://localhost:63287/Home/Index?ID=0
Request.Url.Scheme http
Request.Url.Host localhost
Request.Url.Port 63287
Request.Url.LocalPath /Home/Index
Request.Url.PathAndQuery /Home/Index?ID=0
Request.Url.Query ?ID=0
ViewContext.RouteData.Route.GetRouteData(this.Context).Values["controller"] Home
ViewContext.RouteData.Route.GetRouteData(this.Context).Values["action"] Index

你可能感兴趣的:(ASP.NET MVC 请求路径相关参数的获取)