NOTE: This property is now obsolete.
Gets or sets a value indicating whether smart navigation is enabled.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Visual Basic (Declaration)
<ObsoleteAttribute("The recommended alternative is Page.SetFocus and Page.MaintainScrollPositionOnPostBack. http://go.microsoft.com/fwlink/?linkid=14202")> _
Public Property SmartNavigation As Boolean
Dim instance As Page
Dim value As Boolean
value = instance.SmartNavigation
instance.SmartNavigation = value
[ObsoleteAttribute("The recommended alternative is Page.SetFocus and Page.MaintainScrollPositionOnPostBack. http://go.microsoft.com/fwlink/?linkid=14202")]
public bool SmartNavigation { get; set; }
[ObsoleteAttribute(L"The recommended alternative is Page.SetFocus and Page.MaintainScrollPositionOnPostBack. http://go.microsoft.com/fwlink/?linkid=14202")]
public:
property bool SmartNavigation {
bool get ();
void set (bool value);
}
/** @property */
public boolean get_SmartNavigation ()
/** @property */
public void set_SmartNavigation (boolean value)
public function get SmartNavigation () : boolean
public function set SmartNavigation (value : boolean)
Property Value
true if smart navigation is enabled; otherwise, false.
In most circumstances, do not set this property in code. Set the SmartNavigation attribute to true in the @ Page directive in the .aspx file. When the page is requested, the dynamically generated class sets this property.
When a page is requested by a Microsoft Internet Explorer 5.5 browser, or later, smart navigation enhances the user's experience of the page by performing the following:
-
Eliminating the flash caused by navigation.
-
Persisting the scroll position when moving from page to page.
-
Persisting element focus between navigations.
-
Retaining only the last page state in the browser's history.
Smart navigation is best used with ASP.NET pages that require frequent postbacks but with visual content that does not change dramatically on return. Consider this carefully when deciding whether to set this property to true.
The SmartNavigation property has been deprecated. Use the SetFocus method and the MaintainScrollPositionOnPostback property instead.
Sub Page_Load(Sender As Object, e As EventArgs)
Me.SmartNavigation = true
End Sub
Sub Button_Click(Sender As Object, e As EventArgs)
Label1.Text="<b>The value of 'SmartNavigation' property is </b>" + "'" + Me.SmartNavigation.ToString() + "'"
End Sub
void Page_Load(Object sender, EventArgs e)
{
this.SmartNavigation = true;
}
void Button_Click(Object sender, EventArgs e)
{
Label1.Text="<b>The value of 'SmartNavigation' property is </b>" + "'" + this.SmartNavigation + "'";
}
void Page_Load(Object sender, EventArgs e)
{
this.set_SmartNavigation(true);
} //Page_Load
void Button_Click(Object sender, EventArgs e)
{
Label1.set_Text(
"<b>The value of 'SmartNavigation' property is </b>"
+ "'" + this.get_SmartNavigation() + "'");
} //Button_Click
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
.NET Framework
Supported in: 1.0, 1.1
Obsolete (compiler warning) in 2.0