ASP.NET How do I go to a page anchor

  • Thread starter Thread starter David C. Barber
  • Start date Start date
D

David C. Barber

I'm using VB 2005 and ASP.NET, and after a postback I want to update the
page and return to a specific Anchor tag on that page. I've not been able
to find out how to do this, and as you probably know, the MS VS 2005
documentation is virtually useless compared to, say, VS 6.

Can someone tell me if there's any secret to inserting an Anchor tag into my
ASP page, and then how to get the page to go back to that Anchor tag, rather
than just at the top.

Thanks!
 
David said:
I'm using VB 2005 and ASP.NET, and after a postback I want to update the
page and return to a specific Anchor tag on that page. I've not been able
to find out how to do this, and as you probably know, the MS VS 2005
documentation is virtually useless compared to, say, VS 6.

Can someone tell me if there's any secret to inserting an Anchor tag into my
ASP page, and then how to get the page to go back to that Anchor tag, rather
than just at the top.

Thanks!

You can only do that before the postback. When the request has been sent
to the server, it's too late to change it's url.

You can cause another postback by using Response.Redirect on the server,
or you can use Page.ClientScript.RegisterStartupScript to add some
Javascript that will do another postback when the page loads after the
postback.
 
David,

Always ask ASP.NET questions in the respective newsgroup:

microsoft.public.dotnet.framework.aspnet
 
Back
Top