Request.RawUrl 属性的应用收


原始 URL 定义为 URL 中域信息之后的部分。在 URL 字符串 http://www.contoso.com/articles/recent.aspx 中,原始 URL 为 /articles/recent.aspx。原始 URL 包括查询字符串(如果存在)。
复制代码 代码如下:

if (Request.RawUrl.ToLowerInvariant().Contains("/category/"))
{
DisplayCategories();
}

用来对字符串分析,有选择的导向。
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3