“ASP.global_asax does not exist in the namespace ASP”
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I created a RazorFunctions.cshtml file on App_Code @functions { public static string GetActiveClassIf(string controllerName, string actionName = null) { var routeData = @HttpContext.Current.Request.RequestContext.RouteData; string currentController = routeData.Values["controller"].ToString(); string currentAction = routeData.Values["action"].ToString(); return controllerName == currentController && (String.IsNullOrEmpty(actionName) || currentAction == actionName) ? "active" : ""; } } and when I compile, it give me 2 errors (compilation get