Name
SmartNavigation
Synopsis
Boolean = Page.SmartNavigation Page.SmartNavigation = Boolean
Returns or sets a Boolean indicating whether
the SmartNavigation feature is turned on.
The SmartNavigation feature, which is compatible only with Internet
Explorer, uses <iframe> elements to allow
only portions of the page to be refreshed when the page is posted
back. This can help eliminate the annoying visual flicker associated
with postbacks.
Parameters
-
Boolean A Boolean value that indicates whether or not SmartNavigation is enabled.
Example
The following code example sets the SmartNavigation property to
True using the SmartNavigation
attribute of the @ Page directive. When the page
is posted back, only the current page will be stored in the
browser’s history, so the Back button will be
disabled.
<%@ Page Language="vb" SmartNavigation="True" %>
<html>
<head>
<title>SmartNavigation property example</title>
<script runat="server">
Sub Page_Load( )
Message.Text = "This Label will change."
Message2.Text = "This Label will not change."
End Sub
Sub UpdateLabel(Sender As Object, e As EventArgs)
Message.Text = "This Label has changed."
End Sub
</script>
</head>
<body>
<form runat="server">
<asp:label id="Message" runat="server"/>
<asp:button id="update"
onClick="UpdateLabel"
text="Click to update label text"
runat="server"/>
</form>
<asp:label id="Message2" runat="server"/>
</body>
</html>Notes
In addition to eliminating flicker when navigating or posting back, SmartNavigation maintains the current ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access