September 28, 2022

Samir Daoudi's Technical Blog

SharePoint, Office 365, C#, .Net, SQL Server News, Tips, Ebooks, Events, Webinars ….etc

ASP.net 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

You may have missed

Show Buttons
Hide Buttons

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: