SmartNavigation: To use or not...?

samsmithnz

Senior Contributor
Joined
Jul 22, 2003
Messages
1,038
Location
Boston
I've been reading about this SmartNavigation feature (Suppresses the postback flicker) over the last week, something I stumbled on, and I was wondering if there were any opinions of whether it is a good feature to use or not?

thanks
 
Very buggy. I would recommend NOT using it. It only worked for me as expected on one page I tried it on.

There is also a lot of stuff in a lot of forums saying the same thing I am saying here. Which is sad, because it would be so awesome if it worked.
 
evaleah said:
Very buggy. I would recommend NOT using it. It only worked for me as expected on one page I tried it on.

There is also a lot of stuff in a lot of forums saying the same thing I am saying here. Which is sad, because it would be so awesome if it worked.

What's so buggy about it? I've turned it for today to see if I can see any difference in my asp.net project, and a couple pages don't flicker much, but I haven't seen any bugs yet...
 
I don't find it buggy at all, it's primarily for the page to go back to the same area of the page on postback as it was before the postback.

So if you have a grid 20 inches down and you click to go into edit mode you will see the grid on postback. It works just fine.
 
Most of my pages have controls that are made visible on demand or datagrids that need viewstate enabled, etc. As long as the page has only standard controls do the most basic tasks, I have not had any troubles with it. It is when I have controls that are made visible at runtime or datagrids whose properties are altered at runtime that the smartnavigation causes errors. If you just have textboxes, lables, etc. then it is nice.

On pages where I have manipulated the controls either the page postbacks without them being visible anymore or the page freezes (this was the most common). In some cases the information in the controls that had been made visible was set back to blank rather than maintaining state through postbacks.

If I want a page to show up in a specific place I use a class I created to set focus where I could like it to be after postback. The code for the class is:

Public Class SetFocus

Public Sub SetFocus(ByVal controlToFocus As Control, ByVal callingPage As Page)
Dim scriptFunction As String
Dim scriptClientId As String

scriptClientId = controlToFocus.ClientID

scriptFunction = "<script language='javascript'>"
scriptFunction += "document.getElementById('" & scriptClientId & "').focus();"
scriptFunction += "</script>"

callingPage.RegisterStartupScript("focus", scriptFunction.ToString())
End Sub

End Class


I hope that clarifies things a bit more. I would add links here to other examples of bugs in smartnavigation that people have encountered but didn't keep them after I stopped using the feature altogether.

Eva
 
Thanks for that. Now that I look a little closer, I see that some things are not working as you mentioned. I have removed this feature from my code now too...
 
Back
Top