Is there away to get the current fragment from a route that was issued via action link. This is how I am getting the action from the route.
string currentAction = requestContext.RouteData.Values[“action”] as string ?? “index”;
Can I do something similar to this?
string currentFragment = requestContext.RouteData.Values[“Fragment”] as string ?? “”;
No, you can’t do anything like this. The fragment (everything that follows the
#sign in an url) is never sent to the server by the browser, so the sole fact of talking about getting the url fragment server side simply doesn’t make sense.So if you have the following url:
http://example.com/foo/bar?key1=value1#abcthe server will never be able to fetchabcsimply because the client will never send it.