Reputation: 49
I tried Response.Redirect("page.aspx#here")
but it did not work.
This is the code in my aspx file: <a name="here"></a>
Do I have to redirect to it differently?
Upvotes: 1
Views: 7644
Reputation: 61
The accepted answer here is incorrect.
I am able to make this work in C# by doing the following:
Response.Redirect("page.aspx" + "#here", false);
Upvotes: 3
Reputation: 1066
You can't redirect to an anchor from server-side code, because the anchor is entirely a client-side concept. You'll have to use Javascript for this. See Retrieving Anchor Link In URL for ASP.Net.
Upvotes: -1