ASP.NET How do I go to a page anchor

  • Thread starter David C. Barber
  • 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!
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

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.
 
N

Newbie Coder

David,

Always ask ASP.NET questions in the respective newsgroup:

microsoft.public.dotnet.framework.aspnet
 

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