我在我的网站上使用了第三方服务器端控件(ASP.NET的Teleeled RadControls)。菜单控件具有复杂的结构,这使视图状态的大小膨胀,从而影响加载时间。我不知道viewstate的详细信息,只是Web服务器使用它来跟踪控件值。

由于我网站上的大多数页面仅显示,是否可以禁用未接受用户输入的视图状态?无论如何,所有动态项目都会在页面加载时重新生成。

有帮助吗?

其他提示

In the top of your aspx page add the parameter enableViewstate="false" on the pages that doesn't need it. it won't disable the viewstate completely though, but reduce the size seriously

I haven't tested this, but I think it's possible..

In your Web.config file add the attribute to the pages tag instead, and then on those pages you need it enabled, add the attribute with true in the top

System.Web.UI.WebControls.CheckBox checkBox = new System.Web.UI.WebControls.CheckBox();
checkBox.EnableViewState = false;

There are different ways of disabling ViewState. In your case, I would recommend disabling the viewstate on the control:

<telerik:RadMenu ViewStateMode="Disabled"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top