Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Chart.ViewStateData Property

.NET Framework 4.6 and 4.5

Note: This API is now obsolete.

Gets or sets the user-defined view state of the control.

Namespace:  System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

[ObsoleteAttribute("ViewStateData has been deprecated. Please investigate Control.ViewState instead.")]
public string ViewStateData { get; set; }

Property Value

Type: System.String
A string value that represents the view state of the control, which is embedded in the Web document at the client.

When you specify data to persist at the client, this property provides greater flexibility compared with the ViewStateContent property.

When the user-defined view state is implemented, it is up to the developer to set the view state, and to utilize the view state when a postback occurs.

The Save and Load methods of the ChartSerializer object can optionally be used to set the view state, as well as to load the view state when a postback occurs. See the sample code below for an example of this.

For simplicity, when you specify the chart state to be saved, use the ViewStateContent property, which can be set to data, visual appearance properties or both.

To enable state management, set the EnableViewState property to true.

.NET Framework

Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.5
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5.2
Obsolete (compiler warning) in 4
© 2015 Microsoft