[英]ASP.Net MVC3 RawUrl check
I have this JavaScript code to modify the class of menu items: 我有以下JavaScript代码来修改菜单项的类:
switch(@Request.RawUrl.Trim())
{
case "/MyInfo":
case "/":
case "/MyDocuments":
// add the javascript here
break;
}
My MyDocuments Urls will always be suffixed with ?Page=x
where x is the page number of the documents list. MyMyDocuments Urls的后缀总是?Page=x
,其中x是文档列表的页码。
How would I modify the code in the switch statement to make the modified URLs included in the menu? 如何修改switch语句中的代码,使修改后的URL包含在菜单中?
switch (Request.Url.AbsolutePath.ToLower())
{
case "/myinfo":
case "/":
case "/mydocuments":
// add the javascript here
break;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.