1

我有这个 JavaScript 代码来修改菜单项的类:

switch(@Request.RawUrl.Trim()) 
{
    case "/MyInfo":
    case "/":
    case "/MyDocuments":
        // add the javascript here
        break;
}

我的 MyDocuments 网址将始终带有后缀,?Page=x其中 x 是文档列表的页码。

如何修改 switch 语句中的代码以使修改后的 URL 包含在菜单中?

4

1 回答 1

1
switch (Request.Url.AbsolutePath.ToLower())
{
    case "/myinfo":
    case "/":
    case "/mydocuments":
        // add the javascript here
        break;
}
于 2012-08-24T19:50:18.237 回答