Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Navigating to an anchor within a page

Reply
Thread Tools

Navigating to an anchor within a page

 
 
=?Utf-8?B?S2VuIFNsaWdodA==?=
Guest
Posts: n/a
 
      04-07-2006
Hello. Does anyone know how to navigate to a specific anchor within an ASPX
page? For example, I have <a name='Test'>Hey there</a>, and I want to direct
someone to that anchor in the PageLoad using code. In other words, if
someone navigates to the default.aspx page, I want to immediately take them
to the #Test anchor.

Thanks,


Ken

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      04-07-2006
In ASP.NET1.1 C# syntax, you can add in Page_Load:
this.RegisterStartupScript ("navigateto","<script
type='text/javascript'>document.location.href='#Test';</script>");


--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com


"Ken Slight" wrote:

> Hello. Does anyone know how to navigate to a specific anchor within an ASPX
> page? For example, I have <a name='Test'>Hey there</a>, and I want to direct
> someone to that anchor in the PageLoad using code. In other words, if
> someone navigates to the default.aspx page, I want to immediately take them
> to the #Test anchor.
>
> Thanks,
>
>
> Ken
>

 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2VuIFNsaWdodA==?=
Guest
Posts: n/a
 
      04-07-2006
Phillip,

Thanks a ton. That was perfect.


Ken


"Phillip Williams" wrote:

> In ASP.NET1.1 C# syntax, you can add in Page_Load:
> this.RegisterStartupScript ("navigateto","<script
> type='text/javascript'>document.location.href='#Test';</script>");
>
>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Ken Slight" wrote:
>
> > Hello. Does anyone know how to navigate to a specific anchor within an ASPX
> > page? For example, I have <a name='Test'>Hey there</a>, and I want to direct
> > someone to that anchor in the PageLoad using code. In other words, if
> > someone navigates to the default.aspx page, I want to immediately take them
> > to the #Test anchor.
> >
> > Thanks,
> >
> >
> > Ken
> >

 
Reply With Quote
 
duneshade duneshade is offline
Junior Member
Join Date: Apr 2008
Posts: 1
 
      04-16-2008
There is a function, the 'Server.Transfer("NewPage.aspx");' function or statement call it as you may. This transfers your viewrs from your current page to the NewPage. You can put this statemet anywhere you want. In Ken's case he should have put it in the Page_load() part of his code.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link Button control and anchor within page do not work in Mobile 6.0 David C ASP .Net Mobile 2 08-31-2008 12:23 AM
Page not found error when navigating from the child page back to the parent page Samy Java 0 02-04-2006 01:29 AM
Jumping to anchor within a iFrame - without moving parent page Robert Mark Bram Javascript 1 11-08-2005 02:52 AM
Navigating to a bookmark within an IFrame Adrian Javascript 3 11-02-2005 07:12 PM
Issues with navigating to previous page and keeping custom page properties available Greg Krzeszkowski ASP .Net 3 03-03-2005 04:59 PM



Advertisments