in

ASP.NET Weblogs

[karsten samaschke]

ASP.NET daily. Or weekly.

SmartNavigation and why not to use it

SmartNavigation seems to be a nice feature - it allows Internet Explorer to handle PostBacks in a very clever way. You don't have to worry about having a long site - it will return to the point where you have been before. Or if you define some events - SmartNavigation will enable you to invoke the handlers without posting the page back to the server.

But: If you are going to program a serious website for users of different browsers (Netscape, Opera, Konqueror or Safari) you need to turn SmartNavigation off, because it simply doesn't work with this kind of browsers.

Another aspect is the following behaviour reported in the newsgroups (and not verified by myself ;): If you would like to put the focus on some objects of your page (i.e. textboxes), you usually use JavaScript:

   Page.RegisterClientScriptBlock("focus", _
     "document.<id-of-your-control>.focus();")

or (VB.NET)

   Page.RegisterClientScriptBlock("focus", _
      "<script language=""JavaScript"">" & _
         "document.<id-of-your-control>.focus();" & _
      "</script> ")

But: Try it with SmartNavigation turned on: It simpy won't work on some systems. The reasons are unknown, but it seems to be, as if IE won't interpret the script correctly.

Sad, isn't it?

Comments

 

bino Joseph said:

am facing problem when "Smart Navigation" turned on.My forms has got 2 and more panels inside multipage.If We browse through the same page for long time,the events are not recognised.The browser (IE 6)showing some error(probably java script error).If someone have a better idea what to do,please let me know.
Thanks in advance,
bino291@yahoo.com
September 29, 2003 1:28 AM
 

BarfieldMV said:

When i turn on smartnavigator my asp.net application seems to get stuck when i enter a detail screen and press a Cancel button to get redirected back. Kinda strange behaviour but very wrong.
March 3, 2004 10:11 AM
 

falcryn said:

Hmmm... turned this on and it is a dream-come-true. Tested with Netscape 4,6, & 7 and all works fine. Probably will have an issue eventualy, till then I am lovin it.
March 25, 2004 6:59 PM
 

burnt_toast said:

There are problems with smartnavigation. I have an asp.net page that does form validation and displays a javascript alert if there are errors with the submission. But the js alert gives back an error ("Invalid Pointer") if smartnavigation is turned on.
March 26, 2004 3:52 PM
 

Oksana said:

can somebody tell me why SmartNavigation="true"
doesn't prevent the form from screen flickering when I work with treeView on that page? It looks agly when after each click on the node the page is redrawn.
Any idea how to prevent it?
March 28, 2004 3:06 AM
 

Ram Naresh Yadav. said:

It reset the focus and scroll positon between post back .. it is doing good job.

It is giving javascript error while using browser back. and it is not working link if the page contains relitive path.
..
there is any solutions to this problem.
April 6, 2004 6:49 AM
 

Ajay Jain said:

smartnavigation does problem when the popup window is opened and alongwith it the parent page is refreshed. Under this situation, the parent window comes at top instead of popup window.
April 9, 2004 7:42 AM
 

Guy Cangelosi said:

using SmartNavigation="true" anihilates the CSS Stylesheet after a postback.
The stylesheet being linked in header and using IE6 as a browser.
The HTML (aspx) document is loaded in a Frameset.
April 13, 2004 11:40 AM
 

Adam Gartee said:

I have found that SmartNav crashes Internet Explorer (fully patched as of current) when the page includes CSS styles containing expresssions refering to page elements (DIVs in my case).
April 30, 2004 4:39 PM
 

Daniel Halan said:

Seems also as SmartNav looses the CSS-Styles after first postback, if it is a <link> and added at runtime..
May 20, 2004 5:12 AM
 

Velu said:

When SmartNavigation = "true" i get the page.urlreferer as always null.

SmartNavigation is a very good feature, but it behaves in a errotic manner some times.

June 23, 2004 9:40 AM
 

Ned said:

Mate I don't know what kind of application you have in mind that is causing SmartNavigation to behave in an 'errotic' manner.
June 23, 2004 5:48 PM
 

bud said:

So if it's acting "errotically", is it causing a lot of unwanted popups?
June 25, 2004 2:36 PM
 

Laiju Skaria said:

my server.transfer is not working properly when i turned on smartnavigation
June 29, 2004 8:29 AM
 

Colonel Angus said:

Does anyone know of an alternative to holding scroll position on a postback?
June 29, 2004 10:46 AM
 

Jacky said:

There's also a problem with SmartNav turned on. Try typing a open single quote (The sign directly below the Esc button on most keyboards) preceding some text in a textbox., e.g. `test. Click on a button to make it post back. My textbox dissappears!!!

SmartNav is truly buggy. I hope Microsoft does something abt this.... :(
July 8, 2004 12:21 AM
 

Nilotpal said:

smart navingation doesn't work when i am using layers. my asp.net page contains a layer which again contains controls... when smart navigation turned on, only the outer page is smart navigated... not the inner one...
July 21, 2004 9:35 AM
 

Larry said:

I was looking for some errotic behavior so i turned on SmartNav.

It Works! I am now typing with one hand!
July 30, 2004 10:00 PM
 

TrackBack said:

One of the issues I have with ASP.NET is that it is postback crazy. Virtually nothing of significance can be done in pure browser client code with ASP.NET out of the box*. You have to Submit() the specially formed...
October 27, 2004 12:21 PM
 

TrackBack said:

November 19, 2004 9:06 AM
 

TrackBack said:

davids brain blog &raquo; Blog Archive &raquo; website standards
March 4, 2005 1:51 AM
 

Srinivasa Kumsi said:

In my page, i have the set the SmartNav = true.  On any pastback event, page will disapperars. When i check the server side events using the event log, every thing is fine.

i mean, after postback event, page will not load as expected. we are using IE 6.0 version.

Please guide me.....

June 22, 2007 6:55 AM
 

Kalelur Rahman said:

I found lot of problems when smart navigations set to true. i try to use javascript, but not work...

June 27, 2007 7:41 AM
 

Hexis said:

I have experienced something similar.  In our case we have a page being displayed in Pocket IE on Windows CE.Net 4.2 device.  After approximately 600 refreshes the browser locks up.

Repeating the same experiment on a Windows XP machine running IE 6, the problem does not occur.

The page does explicitly set focus to a input of type text.

July 5, 2007 3:20 PM
 

JB Burayag said:

I have turned on the "Smartnav" and works only after the second time I click on button. why?

July 9, 2007 11:12 AM
 

Anthony Nadar said:

I have a javascript which writes menu dynamicall. When I use SmartNavigation=ture, the menu does not shows. I broke my head and also a colleague's head to get rid of the problem.

August 31, 2007 5:36 AM
 

DeVries48 said:

Microsoft says: use SetFocus and MaintainScrollPositionOnPostback insead.

(Smartnavigation is obsolete)

November 14, 2007 7:42 AM
 

Dem said:

June 18, 2008 2:10 PM

Leave a Comment

(required)  
(optional)
(required)  
Add