Navigating to an anchor within a page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello. Does anyone know how to navigate to a specific anchor within an ASPX
page? For example, I have <a name='Test'>Hey there</a>, and I want to direct
someone to that anchor in the PageLoad using code. In other words, if
someone navigates to the default.aspx page, I want to immediately take them
to the #Test anchor.

Thanks,


Ken
 
In ASP.NET1.1 C# syntax, you can add in Page_Load:
this.RegisterStartupScript ("navigateto","<script
type='text/javascript'>document.location.href='#Test';</script>");
 
Back
Top