Navigating to an anchor within a page

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
 
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top