它控制了ViewState的维护? [英] Which controls have ViewState maintained?
问题描述
我想换行我的头周围的控制基础设施,了解哪些ASP.NET保持视图状态。
I am trying to wrap my head around the control infrastructure to understand which ones ASP.NET maintains view state for.
有这些常规的HTML控件例如:
<输入类型=检查单选=检查/>
- >据我了解,这些没有视图状态
There are these regular HTML controls ex:
<input type="radio" checked="checked"/>
-> I understand these do not have viewstate
再就是用=服务器的HTML控件
&LT;输入类型=检查单选=检查=服务器/&GT;
- >是否视图状态得到保持回发之间
Then there are HTML controls with runat="server"
<input type="radio" checked="checked" runat="server"/>
-> Does the viewstate get maintained between postbacks?
还有一些ASP.NET控件
&LT; ASP:文本框的id =txtMyText=服务器/&GT;
- >据我所知,这些是有视图状态
Then there are ASP.NET controls
<asp:TextBox id="txtMyText" runat="server"/>
-> I understand these do have viewstate
我们必须继承一些自定义的控件HtmlTextBox
&LT;我的preFIX:myTextBox ID =txtMyText=服务器/&GT;
- >这是一样的上述类型2
We have a few custom controls that inherit HtmlTextBox
<myPrefix:myTextBox id="txtMyText" runat="server"/>
-> Is this the same as type 2 above?
它是安全的假设,与 =服务器
标签将视图状态保持?
Is it safe to assume that any control with runat="server"
tag will have viewstate maintained?
推荐答案
有3种类型的控件,比如,HTML服务器控件,因为他们RUNAT =服务器标签,并将完整的web控制了标准的HTML元素。只有Web控件已视图状态保持。
There are 3 types of controls, the standard HTML elements like , HTML server controls which have the runat=server tag added, and full web controls. Only the web controls have viewstate maintained.
这篇关于它控制了ViewState的维护?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!