开发者

How come there is an option for fragment but I can't retrieve it?

开发者 https://www.devze.com 2023-03-12 10:51 出处:网络
In ASP.net why is there an option 开发者_运维知识库to get the URL fragment (aka. Hash) but I cannot get the fragment from it. requestContext.HttpContext.Request.Url.Fragment.

In ASP.net why is there an option 开发者_运维知识库to get the URL fragment (aka. Hash) but I cannot get the fragment from it. requestContext.HttpContext.Request.Url.Fragment.

Now I understand that you can't get the fragment because the server never knows about it but I want to know why the option is there with in the HttpContext object.


Because HttpContext.Request.Url is of type System.Uri, and that one has a Fragment parameter. When using System.Uri on it's own, it's certainly possible to add/read the fragment, just in this scenario where it's used by ASP.net's runtime, it's not applicable.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号