|
Article relates to |
RadControls |
|
Created by |
Paul, Telerik |
|
Last modified |
June 12, 2006 |
|
Last modified by |
Paul, Telerik |
QUESTION Do RadControls support the use of
SmartNavigation?
SOLUTION for VS 2003
In principle RadControls support the SmartNavigation feature, however this depends on the RadControls features which you would like to use. Sometimes when the SmartNavigation is enabled, RadControls can interfere with other ASP.NET server controls in unpredictable ways, of which RadEditor and RadTreeView are impacted the most (implications are described below).
After much research on the topic, our developers believe that SmartNavigation is one of the few ASP.NET features which do not keep up to what Microsoft promised. It is known for some time that SmartNavigation is notorious for causing problems with the usage of advanced JavaScript, and in general we discourage our clients to use it. Here is a small part on SmartNavigation during our research:
(excerpt from http://weblogs.asp.net/ksamaschke/archive/2003/04/27/6085.aspx)
"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."
If you decide to turn SmartNavigation off, we have two suggestions which should be able to help you achieve the same or similar results:
- If you use SmartNavigation to omit refreshing the page after postback, you can use the following code in the tag of the page (Note: Works for IE 5.5 and above.):
<meta http-equiv="Page-Enter" content="revealTrans(Duration=0,Transition=5)">
- If you use SmartNavigation for retaining the scroll position after postback you can find some nice workarounds for this using JavaScript (or just use the RetainScrollPosition property if this concerns RadTreeView). Just search the net and you will find several solutions.
Below are described some of the known issues related to the SmartNavigation usage:
Impact on RadEditor
- By using extensive client side scripting that registers new html elements,SmartNavigation sometimes breaks the RadEditor and RadSpell scripts. We recommend turning that option off by editing your web.config. Just put that line inside the <web.config> element:
<pages smartNavigation="false" validateRequest="false"></pages>
- When using the RadEditor control inside an ASP:DataGrid control and when editing a row of the DataGrid, some elements disappear. For example, there is no text beside the html check box. Also, the spell checker is not available in this case. The JavaScript required by the control (var_localization ..) is not posted back to the client browser.
Impact on RadTreeView
- Expanding a node, collapsing it, and re-expanding it doesn't result in a server side Expand event (the second time, after collapsing it).
- The JavaScript fails onExpand on an item when using LoadOnDemand.
- Using SmartNavigation on a page breaks the Drag and Drop postback.
- RetainScrollPosition property does not work at all.
Impact on RadSpell
- The spell dialog shows up but it doesn't do anything (it is empty), i.e.

SOLUTION for VS 2003
Instead of “SmartNavigation” use “MaintainScrollPositionOnPostback=true".
In addition, in ASP.NET 2.0, System.Web.UI.Page.SmartNavigation is marked obsolete and is deprecated in ASP.NET v2.0. The recommended alternative is Page.SetFocus and Page.MaintainScrollPositionOnPostBack. For details on the subject, please visit http://go.microsoft.com/fwlink/?linkid=14202.
Furthermore, we highly suggest you take a look at the following solution that might do the trick in most of the cases (thanks Jason for providing the link).
Please
Sign In
to rate this article.