2013-08-20 55 views
1

我有一个MVC应用程序。有菜单项,我想比较点击菜单项路由值与Request.FilePath检测它们是否相等。但是菜单项的路由值是。比较路径值与Request.FilePath

/Product/it/Statue-1?deleteSession=True 

和Request.FilePath是

/Product/it/Statue-1 

我该怎么办呢?

+1

'FirstOne.StartsWith(SecondOne)' – wudzik

+0

您想在比较时考虑“?deleteSession = True”吗? –

回答

0

您可以使用Request.Url.PathAndQuery而不是Request.FilePath来获取完整路径和查询字符串。