Can a 'bookmark' link be put in an asp.net page?

  • Thread starter Thread starter COHENMARVIN
  • Start date Start date
C

COHENMARVIN

In html I learned that you could have a tag such as:
<a name="go_here">
Then, if you linked to the page, as follows <a
href="MyPage.htm#go_here">
You would go to the particular position
in the page where 'go_here' was.
I need to do something like that, but Visual Studio doesn't have any
tag that looks like:
<a name="etc
Is this something that can be done in VS?
Or is there a better way to make a page go to a particular position in
the page?
Thanks,
Marv
 
re:
!> is there a better way to make a page go to a particular position in the page?

There's several approaches to that.

The simplest is to use a Page directive :

<%@ Page MaintainScrollPositionOnPostback="true"%>

Then, there's Fredrik Normén's script :

http://forums.asp.net/p/948134/1149902.aspx

Then, there's Jeff Prosise's script :
http://searchwindevelopment.techtarget.com/tip/0,289483,sid8_gci931802,00.html

However, none of those work with external links, only with postbacks.

If you don't want the page to start at the top, you can use a control and set focus to it :

SomeControl.SetFocus()



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
re:
!> It's not an ASP.Net kind of thing - -

That's not what the OP was asking about.

He wants to know whether a link like
<a href="MyPage.htm#go_here"> works in ASP.NET.

It does not.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Back
Top