سؤال

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