Setting and Redirecting to a Page Anchor

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!
 
M

Mark Fitzpatrick

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

Nick Chan

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)
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top