Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 5th, 2004, 11:41 AM
Authorized User
Join Date: Jul 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default SmartNavigation="true"

Hey all,

I have been using the @Page paramater 'SmartNavigation' to help control page position on postbacks to prevent users from needing to scroll back to the position they were at on the page when they created the postback. The problem I am running into is that I have various elements on the page (Header, Footer, left side navaigation) being controlled and drawn by client side JavaScript. When ever I use 'SmartNavigation' on a page that uses post back I lose the page elements being drawn by the JavaScript. Have any of you encountered this before or know why this happens or even know of a work around? I have disabled the SmartNavigation at this time.

there is no place like
there is no place like
Old January 5th, 2004, 12:01 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

SmartNavigation is neat, but I have also had it cause problems. It uses this method of implementing some iframes and a bunch of javascript. It think what it's actually doing is posting the page to the hidden iframe, then taking the result and repainting the visible window with it. If you watch closely you'll actually see 2 or 3 page requests being made in the browser. It's black magic to me!

I've noticed that sometimes a page doesn't give me that "This page requires a re-post" prompt when I refresh or go back or forward. It's strange. I found that it was being caused by smart nav.

I create this method before I realized what smart navigation was. Add 2 hidden form fields to the form, and write the current page position (scrollTop and scrollLeft) to those fields in the body onScroll handler. Then when the page is posted back you can grab those values in the ASPX code and write a bit of javascript to SET those values when the page loads in the client. One drawback to this is that you don't get the focus back on the current control like in SmartNavigation. However, there is one major advantage to this method, even though it's not as "pretty" as SmartNavigation: it works in other browsers. When SmartNav is on, you only get it in I.E. (at least from what I have seen).

Work smarter, not harder.
Old September 3rd, 2004, 01:29 PM
Registered User
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Could you post the source of the javascript that you are using.
It would be very useful.


Similar Threads
Thread Thread Starter Forum Replies Last Post
smartNavigation problems geofbirchall ASP.NET 1.0 and 1.1 Basics 1 March 16th, 2005 11:18 AM
Move to the next control using SmartNavigation katsarosj ASP.NET 1.0 and 1.1 Basics 3 February 5th, 2004 04:35 PM
Stupid but true Adam H-W SQL Server 2000 3 December 6th, 2003 12:16 PM
SmartNavigation and Screen Flicker Jan_Ma ASP.NET 1.0 and 1.1 Basics 0 June 28th, 2003 08:37 PM
SmartNavigation and screen flickers Jan_Ma ASP.NET 1.x and 2.0 Application Design 0 June 28th, 2003 08:35 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.