您的位置:首页 > 产品设计 > UI/UE

获取当前访问的部分虚拟路径(Request.Url.GetLeftPart)

2011-07-02 09:52 555 查看
/article/10462362.html

Request.Url.GetLeftPart的应用://发送按钮<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default3.aspx?id=10&name=aa">HyperLink</asp:HyperLink>//接收页面string baseUrl = "Path:" + Request.Url.GetLeftPart(UriPartial.Path) + "<br>|" + "Authority:" + Request.Url.GetLeftPart(UriPartial.Authority) + "<br>|" + "Query:" + Request.Url.GetLeftPart(UriPartial.Query) + "<br>|" + "Scheme:" + Request.Url.GetLeftPart(UriPartial.Scheme); Response.Write(baseUrl);
//显示结果Path:http://localhost:1061/WebSite1/Default3.aspx
|Authority:http://localhost:1061
|Query:http://localhost:1061/WebSite1/Default3.aspx?id=10&name=aa
|Scheme:http://
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐