Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Goto a location on the WebPage without scrolling

Status
Not open for further replies.
Aug 16, 2001
26
0
0
NZ
I have a link to UPDATE the contents of my Web page. Upon click of the UPDATE link, i'm submitting the page to do the db update at the server end.

Everytime i click Update the webpage gets scrolled to the top. I need to hold the page exactly at the same point after the Update process.

I understand that this is possible by using...
<a href="#C4">Click here to Goto Para-4</a>
<a name="C4"><h2>Para-4</h2></a>

But this would require user intervention to goto that location in my page.

But i want to make it all happen when i click on Update and submit the page.

Is there a way, that after the page is being posted to directly goto a location in the page.

Please let know !
 
There is a method for achieving in ASP.NET called SmartNavigation. You can enable it in the page directive using SmartNavigation="true" or for all of your app in the web.config file.

It's a bit buggy in the current release of ASP.NET and hence lots of people don't use it. Do a keyword search in this forum for SmartNavigation, it has been discussed here many times before.

Rob

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
Here's a link to my workaround for not having to use SmartNavigation. Calling SmartNavigation a bit buggy is like saying that Bill Gates is a little wealthy. ;-)

thread855-811655

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Thanks! to everyone for responding
I finally got it working, I tried this...

I called the below JScript OnLoad of my web page by passing the required HyperLink Name (stored in a Hidden Field).

function OnLoadGotoSubSec()
{
window.location.hash=document.cpf.hGotoSubSecNo.value;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top