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://

转自http://hi.baidu.com/85532332/blog/item/929192080b6254c33ac76379.html

相关文章:

  • 2022-12-23
  • 2021-11-23
  • 2021-11-23
  • 2021-11-23
  • 2021-07-10
  • 2021-10-20
猜你喜欢
  • 2021-11-30
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
  • 2021-07-03
相关资源
相似解决方案