문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top