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