国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

獲取當前url

2020-01-18 01:55:20
字體:
來源:轉載
供稿:網友
如: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好了,這個得到的正確的。:)


4.Javascript取url值 
剛寫的一個小實例.實際中使用還是蠻多的.


[Ctrl+A 全選 注:如需引入外部Js需刷新才能執行]
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 安岳县| 介休市| 远安县| 巴林左旗| 闽侯县| 如皋市| 奉化市| 容城县| 基隆市| 黄冈市| 栾城县| 铅山县| 南江县| 大冶市| 休宁县| 海门市| 探索| 开远市| 大田县| 宜兰市| 金堂县| 和龙市| 巢湖市| 卓尼县| 慈溪市| 启东市| 新野县| 昌吉市| 金平| 商都县| 安徽省| 瑞昌市| 桓台县| 台东市| 湾仔区| 江永县| 永修县| 阳山县| 延长县| 子洲县| 浑源县|