<%
@ Page language
=
"
c#
"
Codebehind
=
"
xxx.cs
"
AutoEventWireup
=
"
false
"
SmartNavigation
="true"
Inherits
=
"
xxx
"
%>
SmartNavigation 是个什么东东,以前从来没有玩过啊:( 查看MSDN如下:
Page.SmartNavigation 属性
SmartNavigation 是个什么东东,以前从来没有玩过啊:( 查看MSDN如下:
Page.SmartNavigation 属性
注意:此属性现在已过时。
获取或设置指示是否启用智能导航的值。命名空间:System.Web.UI
程序集:System.Web(在 system.web.dll 中)
语法
Visual Basic(声明)
<ObsoleteAttribute("The recommended alternative is Page.SetFocus and Page.MaintainScrollPositionOnPostBack. http://go.microsoft.com/fwlink/?linkid=14202")> _ Public Property SmartNavigation As Boolean
Visual Basic(用法)
Dim instance As Page Dim value As Boolean value = instance.SmartNavigation instance.SmartNavigation = value
C#
[ObsoleteAttribute("The recommended alternative is Page.SetFocus and Page.MaintainScrollPositionOnPostBack. http://go.microsoft.com/fwlink/?linkid=14202")] public bool SmartNavigation { get; set; }
C++
[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); }
J#
/** @property */ public boolean get_SmartNavigation () /** @property */ public void set_SmartNavigation (boolean value)
JScript
public function get SmartNavigation () : boolean public function set SmartNavigation (value : boolean)
属性值
如果启用智能导航,则为 true;否则为 false。
备注
在大多数情况下不要在代码中设置该属性。在 .aspx 文件的 @ Page 指令中将 SmartNavigation 属性设置为 true。请求该页时,动态生成的类将设置该属性。
Microsoft Internet Explorer 5.5 或更高版本浏览器请求页时,智能导航将通过执行下面的功能提高用户对该页的操作能力:
-
消除导航导致的闪烁。
-
从一页移动到另一页时保持滚动位置。
-
保持导航之间的元素焦点。
-
在浏览器的历史记录中只保留最后一页的状态。
智能导航最适用于需要频繁回发但是其可是内容在返回时不会发生显著更改的 ASP.NET 页。在决定是否将该属性设置为 true 时,请仔细考虑这一点。
原来如此,结果直接搜索SmartNavigation,发现好多人碰到这种问题:
1 竟然能让Response.Redirect("/default.aspx")失效了?
2 页面中的javascript 运行不正常
3 验证控件失灵,按钮没反应
4 导致css无效 等等
去掉此属性,一切恢复,终于舒了一口气~~
最后还有个问题:为什么会导致这些问题呢?