Page.SmartNavigation Page.SmartNavigation Page.SmartNavigation Page.SmartNavigation Property

定義

警告

此 API 現已淘汰。

取得或設定值,表示是否允許智慧型巡覽。Gets or sets a value indicating whether smart navigation is enabled. 這個屬性已被取代。This property is deprecated.

public:
 property bool SmartNavigation { bool get(); void set(bool value); };
[System.ComponentModel.Browsable(false)]
[System.Obsolete("The recommended alternative is Page.SetFocus and Page.MaintainScrollPositionOnPostBack. http://go.microsoft.com/fwlink/?linkid=14202")]
public bool SmartNavigation { get; set; }
member this.SmartNavigation : bool with get, set
Public Property SmartNavigation As Boolean

屬性值

如果已啟用智慧型巡覽則為 true;否則為 falsetrue if smart navigation is enabled; otherwise, false.

備註

在大部分的情況下,請勿在程式碼中設定此屬性。In most circumstances, do not set this property in code. 在 .aspx 檔案的true @ Page指示詞中,將屬性設定為。SmartNavigationSet 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.

注意

在 ASP.NET 版本2.0 中, SmartNavigation屬性已被取代。In ASP.NET version 2.0, the SmartNavigation property is deprecated. 請改用MaintainScrollPositionOnPostBack方法和屬性。 SetFocusUse the SetFocus method and the MaintainScrollPositionOnPostBack property instead.

當 Microsoft Internet Explorer 5.5 瀏覽器或更新版本要求頁面時,智慧型導覽會執行下列動作,藉此增強網頁的使用者體驗:When a page is requested by 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.

智慧型導覽最適合用於需要頻繁回傳的 ASP.NET 網頁,但不會大幅變更傳回的視覺內容。Smart navigation is best used with ASP.NET pages that require frequent postbacks but with visual content that does not change dramatically on return. 在決定是否要將此屬性設為true時,請仔細考慮這一點。Consider this carefully when deciding whether to set this property to true.

適用於

另請參閱