Thu. Nov 21st, 2019

Samir Daoudi's Technical Blog

SharePoint, Office 365, C#, .Net, SQL Server News, Tips, Ebooks, Events, Webinars ….etc move to anchor location programatically

Hi guys,


If you also have the requirement to programatically go to an anchor location, you can use the following line of code

I had to use this, to go down in the page after the event page submit, to display automatically the search results and avoid the users scroll down to see the search results.

ClientScript.RegisterStartupScript(this.GetType(), "hash", "location.hash = '#ANCHORNAME';", true);

You should have at some point in your html code an anchor called ANCHORNAME

Leave a comment

Show Buttons
Hide Buttons
%d bloggers like this: