Setting and Redirecting 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!
 
To go to that anchor you really need to redirect back to the page again,
passing the anchor to it as such mypage.aspx#mybookmark It can probably be
done by inserting JavaScript into the page through a literal control, but I
haven't ever had to do this myself. Keep in mind, a lot of the things aren't
going to be in the documentation because they aren't really applicable to
the tools but the technology in general which is covered very well in other
places. It was much easier to write documentation for VS6 when so little of
the suite was devoted to anything other than building desktop apps and
services, the web has it's very own techniques and most of them come about
outside the realm of documentation anyways.
 
hi u can do something like this

dim x as new literal
x.text = "<a name=""blabla""/><script>window.onload=function()
{location.href='#blabla'}</script>"
form.controls.add(x)
 
Back
Top