I already searched on many Websites but I found no solution :-( I want to use the ViewState after the Postback (after clicking on a Image link).
my PageLoad:
protected void Page_Load(object sender, EventArgs e)
{
...
if (!IsPostBack && !IsCallback)
{
pivotPlan.DataSource = Keys.ToList();
ViewState["pivotPlan"] = pivotPlan.DataSource;
}
else
{
pivotPlan.DataSource = ViewState["pivotPlan"];
}
}
The strange Thing is that the ViewState is null when I step through the code and the Debugger reaches the masterpage. I enabled the ViewState in the masterpage, but when I click on the imagebutton I will get this error:
Server Error in '/' Application.
The state information is invalid for this page and might be corrupted. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The state information is invalid for this page and might be corrupted.
Source Error: [No relevant source lines]
Source File: c:\Users\neunin\AppData\Local\Temp\Temporary ASP.NET Files\root\7b4d9801\69af7fa1\App_Web_2nxwrvxv.1.cs Line: 0
I really don't have a clue what the Problem is :( Maybe anybody can help me? Thank you very much in advance! :-)
Regards, Nina