Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top