I'm using the RadGrid with a LinqDataSource and keep getting "The state information is invalid for this page and might be corrupted." error
What am I doing wrong?
The problem only occurs on the production server.
Windows Server 2008 setup in a web farm of 3 computers.
The following code generates an error. on the production server on postbacks (e.g. sorting, filtering or paging)... but not every single postback (about 1 in 3).
here is the complete error
I've looked everywhere to see what the problem to this is... the following link is the closest to help identify the problem that I've come across even though it's an old post seems to be the same sort of problem
http://www.telerik.com/community/forums/aspnet-ajax/grid/does-current-futures-build-support-linq-datasources.aspx
To test I've created the same page but linked the LinqDataSource to a GridView and don't get the error paging and sorting work fine.
also if I just change the LinqDataSource1_Selecting to not use "select new { ... } I also don't get the error... e.g.
Please help... I really need to fix this problem.
Have I missed something obvious?
Could this have something to do with the Production server running as a webfarm?
Has anyone else experienced this problem?
What am I doing wrong?
The problem only occurs on the production server.
Windows Server 2008 setup in a web farm of 3 computers.
The following code generates an error. on the production server on postbacks (e.g. sorting, filtering or paging)... but not every single postback (about 1 in 3).
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="page2.aspx.cs" Inherits="site_admin_page2" %> |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head runat="server"> |
<title></title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<asp:LinqDataSource ID="LinqDataSource1" runat="server" |
onselecting="LinqDataSource1_Selecting"> |
</asp:LinqDataSource> |
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
</telerik:RadScriptManager> |
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" |
AllowPaging="True" AllowSorting="True" DataSourceID="LinqDataSource1" |
GridLines="None"> |
<MasterTableView DataSourceID="LinqDataSource1"> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</ExpandCollapseColumn> |
</MasterTableView> |
</telerik:RadGrid> |
</div> |
</form> |
</body> |
</html> |
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Web; |
using System.Web.UI; |
using System.Web.UI.WebControls; |
public partial class site_admin_page2 : System.Web.UI.Page |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e) |
{ |
DynamicData01DataContext dc = new DynamicData01DataContext(); |
var products = from p in dc.tbl_Products |
select new |
{ |
p.ProductID, |
p.ProductName, |
p.ProductPrice, |
p.ProductActive |
}; |
e.Result = products; |
} |
} |
here is the complete error
Server Error in '/site' 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:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\site\f1255035\ee4d6829\App_Web_page2.aspx.c2099ada.oslnjh5d.0.cs Line: 0 |
Assembly Load Trace: The following information can be helpful to determine why the assembly 'App_Web_page2.aspx.c2099ada.phfinkbb, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' could not be loaded. |
WRN: Assembly binding logging is turned OFF. |
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. |
Note: There is some performance penalty associated with assembly bind failure logging. |
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. |
Stack Trace: |
[FileNotFoundException: Could not load file or assembly 'App_Web_page2.aspx.c2099ada.phfinkbb, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.] |
System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0 |
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +64 |
System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58 |
System.Type.GetType(String typeName, Boolean throwOnError) +59 |
System.Web.UI.ObjectStateFormatter.DeserializeType(SerializerBinaryReader reader) +153 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +8625890 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +784 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +392 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +404 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +404 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +404 |
System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +392 |
System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream) +135 |
[ArgumentException: The serialized data is invalid.] |
System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream) +199 |
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +291 |
System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4 |
System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37 |
System.Web.UI.HiddenFieldPageStatePersister.Load() +113 |
[ViewStateException: Invalid viewstate. |
Client IP: 122.111.98.153 |
Port: 57393 |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) |
ViewState: /wEPDwUJMTU0NjY3OTgxD2QWAgIDD2QWBAIBDw9kPCsABgBkAgUPPCsADQIAFCsAAg8WCB4LXyFJdGVtQ291bnQCAR4LXyFEYXRhQm91bmRnHhdFbmFibGVBamF4U2tpblJlbmRlcmluZ2geC0VkaXRJbmRleGVzFgBkFwEFD1NlbGVjdGVkSW5kZXhlcxYAARYCFgpkFCsABBQrAAUWEB4KSGVhZGVyVGV4dAUJUHJvZHVjdElEHglEYXRhRmllbGQFCVByb2R1Y3RJRB4DX3NlBQlQcm9kdWN0SUQeCFJlYWRPbmx5Zx4IRGF0YVR5cGUZKwEeBG9pbmQCAh4EX2NmdmQeBF9jZmZkZGRkBQlQcm9kdWN0SUQUKwAFFhAfBAULUHJvZHVjdE5hbWUfBQULUHJvZHVjdE5hbWUfBgULUHJvZHVjdE5hbWUfB2cfCBkrAh8JAgMfCmQfC2RkZGQFC1Byb2R1Y3ROYW1lFCsABRYQHwtkHwpkHwYFDFByb2R1Y3RQcmljZR8EBQxQcm9kdWN0UHJpY2UfBQUMUHJvZHVjdFByaWNlHwgZKVtTeXN0ZW0uRGVjaW1hbCwgbXNjb3JsaWIsIFZlcnNpb249Mi4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5HwdnHwkCBGRkZAUMUHJvZHVjdFByaWNlFCsABRYQHwQFDVByb2R1Y3RBY3RpdmUeA19kZgUNUHJvZHVjdEFjdGl2ZR8GBQ1Qcm9kdWN0QWN0aXZlHwdnHwgZKwMfCQIFHwpkHwtkZGRkBQ1Qc...] |
[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.] |
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106 |
System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) +14 |
System.Web.UI.HiddenFieldPageStatePersister.Load() +217 |
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105 |
System.Web.UI.Page.LoadAllState() +43 |
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785 |
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242 |
System.Web.UI.Page.ProcessRequest() +80 |
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 |
System.Web.UI.Page.ProcessRequest(HttpContext context) +49 |
ASP.site_admin_page2_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\site\f1255035\ee4d6829\App_Web_page2.aspx.c2099ada.oslnjh5d.0.cs:0 |
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 |
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 |
Version Information: Microsoft .NET Framework Version:2.0.50727.4016; ASP.NET Version:2.0.50727.4016 |
I've looked everywhere to see what the problem to this is... the following link is the closest to help identify the problem that I've come across even though it's an old post seems to be the same sort of problem
http://www.telerik.com/community/forums/aspnet-ajax/grid/does-current-futures-build-support-linq-datasources.aspx
To test I've created the same page but linked the LinqDataSource to a GridView and don't get the error paging and sorting work fine.
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head runat="server"> |
<title></title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<asp:LinqDataSource ID="LinqDataSource1" runat="server" |
onselecting="LinqDataSource1_Selecting"> |
</asp:LinqDataSource> |
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" |
AllowSorting="True" DataSourceID="LinqDataSource1"> |
</asp:GridView> |
</div> |
</form> |
</body> |
</html> |
also if I just change the LinqDataSource1_Selecting to not use "select new { ... } I also don't get the error... e.g.
protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e) |
{ |
DynamicData01DataContext dc = new DynamicData01DataContext(); |
var products = from p in dc.tbl_Products |
select p; |
e.Result = products; |
} |
Please help... I really need to fix this problem.
Have I missed something obvious?
Could this have something to do with the Production server running as a webfarm?
Has anyone else experienced this problem?