我的网址如下:
@H_502_2@www.example.com/{languagecode}/{controller}/{action}/{id}
语言代码是en-us等等
从OnActionExecuting事件中,我如何获得这些值?
解决方法
@H_502_2@protected override void OnActionExecuting(System.Web.Mvc.ActionExecutingContext filterContext)
{
var languagecode = filterContext.RouteData.Values["languagecode"];
base.OnActionExecuting(filterContext);
}