/
StateItem.xml
114 lines (107 loc) · 7.99 KB
/
StateItem.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<Type Name="StateItem" FullName="System.Web.UI.StateItem">
<TypeSignature Language="C#" Value="public sealed class StateItem" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit StateItem extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.StateItem" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class StateItem" />
<TypeSignature Language="F#" Value="type StateItem = class" />
<TypeSignature Language="C++ CLI" Value="public ref class StateItem sealed" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Represents an item that is saved in the <see cref="T:System.Web.UI.StateBag" /> class when view state information is persisted between Web requests. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
View state is the accumulation of a page's or an ASP.NET server control's property values and is sent to the requesting browser in a hidden field.
You can explicitly add <xref:System.Web.UI.StateItem> objects to an ASP.NET server control's <xref:System.Web.UI.StateBag> object using either the <xref:System.Web.UI.StateBag.Item%2A> property or the <xref:System.Web.UI.StateBag.Add%2A> method. The <xref:System.Web.UI.StateBag> then tracks changes to all the items that it stores. Any changes to a <xref:System.Web.UI.StateItem> object are reflected in its <xref:System.Web.UI.StateItem.IsDirty%2A> property. These changes are saved by a call to the <xref:System.Web.UI.Control.SaveViewState%2A> method during the save view state phase of server control processing, just before the control is rendered to the page. For more information, see [ASP.NET Web Server Controls](https://docs.microsoft.com/previous-versions/dotnet/netframework-3.0/7698y1f0(v=vs.85)).
## Examples
The following code example uses the <xref:System.Web.UI.StateItem.Value%2A> and <xref:System.Web.UI.StateItem.IsDirty%2A> properties of the <xref:System.Web.UI.StateItem> class to save the state of a simple custom ASP.NET server control class, `StateBagSample`. When the page has posted to the server, the <xref:System.Web.UI.StateItem.IsDirty%2A> property checks whether the item has been modified. The state values are displayed by accessing the <xref:System.Web.UI.StateItem.Value%2A> property.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/StateBag_IStateManager_Sample1/CS/ism_statebag_samples.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/StateBag_IStateManager_Sample1/VB/ism_statebag_samples.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.StateBag" />
<altmember cref="M:System.Web.UI.Control.SaveViewState" />
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/75x4ha6s(v=vs.100)">ASP.NET State Management Overview</related>
</Docs>
<Members>
<Member MemberName="IsDirty">
<MemberSignature Language="C#" Value="public bool IsDirty { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsDirty" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.StateItem.IsDirty" />
<MemberSignature Language="VB.NET" Value="Public Property IsDirty As Boolean" />
<MemberSignature Language="F#" Value="member this.IsDirty : bool with get, set" Usage="System.Web.UI.StateItem.IsDirty" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool IsDirty { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the <see cref="T:System.Web.UI.StateItem" /> object has been modified.</summary>
<value>
<see langword="true" /> if the stored <see cref="T:System.Web.UI.StateItem" /> object has been modified; otherwise, <see langword="false" />.</value>
<remarks>To be added.</remarks>
<altmember cref="P:System.Web.UI.Control.IsTrackingViewState" />
</Docs>
</Member>
<Member MemberName="Value">
<MemberSignature Language="C#" Value="public object Value { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance object Value" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.StateItem.Value" />
<MemberSignature Language="VB.NET" Value="Public Property Value As Object" />
<MemberSignature Language="F#" Value="member this.Value : obj with get, set" Usage="System.Web.UI.StateItem.Value" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Object ^ Value { System::Object ^ get(); void set(System::Object ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the value of the <see cref="T:System.Web.UI.StateItem" /> object that is stored in the <see cref="T:System.Web.UI.StateBag" /> object.</summary>
<value>The value of the <see cref="T:System.Web.UI.StateItem" /> stored in the <see cref="T:System.Web.UI.StateBag" />.</value>
<remarks>To be added.</remarks>
<altmember cref="T:System.Web.UI.StateBag" />
<altmember cref="P:System.Web.UI.Control.ViewState" />
</Docs>
</Member>
</Members>
</Type>