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> ” & _
      “document..focus(); “)

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?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s