获取当前url
来源:互联网 发布:淘宝新店开张宣传语 编辑:程序博客网 时间:2024/05/17 21:50
如:http://localhost/newurl/WebForm1.aspx
1.方法document.URL(注意大小写)
结果是:http://localhost/newurl/WebForm1.aspx
2.HttpContext.Current.Request.Url.ToString(),
结果:http://localhost/newurl/WebForm1.aspx
3.HttpContext.Current.Request.Url.PathAndQuery;
结果:/newurl/WebForm1.aspx
备注:
如果当前URL为
http://localhost/search.aspx?user=tinyfool&tag=%BC%BC%CA%F5
通过HttpContext.Current.Request.Url.ToString()获取到的却是
http://localhost/search.aspx?user=tinyfool&tag=¼¼Êõ
这显然不对,怎么办?用HttpContext.Current.Request.Url.PathAndQuery好了,这个得到的正确的。:)
- 获取当前URL
- 获取当前URL
- 正确获取当前URL
- 获取当前url
- 获取当前url
- 获取当前页面URL
- js获取当前URL
- DJANGO获取当前URL
- js 获取当前url
- js 获取当前url
- 【php】获取当前url
- 获取当前url
- 获取当前URL
- php获取当前url
- PHP获取当前url
- 获取当前URL地址
- thinkphp 获取当前url
- 获取当前页面 URL
- 几个C#常用正则表达式的总结
- 国内第一本Django图书《Django Web开发指南》
- chmod命令详细用法
- ASP.NET 数据访问类
- 有道趣味题
- 获取当前url
- ASP.NET常用函数(推荐)
- 离线安装VisualSVN Server 1.7.1与Trac
- C语言编译全过程
- util.js文件介绍
- 【转】初学LINUX的建议
- SQL Server存储过程基本语法
- ASP.NET上传图片并生成可带版权信息的缩略图
- 用javascript打造搜索工具栏