禁用整个页面的视图状态 [英] disable viewstate of whole page

查看:88
本文介绍了禁用整个页面的视图状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以一次将整个页面(包括所有控件)的viewstate设为false.我的意思是我不想为所有控件都设置enableviewstate ="false".已使enableviewstate ="false",但仍启用的所有控件的viewstate..

以及EnableViewState ="False"实际上在Page指令中的工作原理.

Is it possible to make the viewstate false of whole page including all controls at a time.I mean I don''t want to set enableviewstate="false" for all controls..In the page directive of the aspx page I have made enableviewstate="false" but still viewstate of all the controls of the is enabled..

And what the EnableViewState="False"actually works within Page directive.

推荐答案

您可以使用以下代码:
You can use something like this:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContentPage.aspx.cs" Inherits="AjaWorks.Control.Centre.Web.ContentPage" EnableViewState="False" %>



您将无法完全摆脱viewstate,但是将EnableViewState设置为false应该会大大减少它

问候



You will not be able to completely get rid of the viewstate, but setting EnableViewState to false should reduce it significantly

Regards


此处

启用和禁用ViewState [ ^ ]
Here

Enabling and Disabling ViewState[^]


这篇关于禁用整个页面的视图状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆