Welcome Guest Search | Active Topics | Sign In | Register

Failed to load viewstate error on grid postback Options
Mihaela Lungu
Posted: Friday, November 2, 2018 4:50:02 AM
Rank: Newbie
Groups: Member

Joined: 10/18/2017
Posts: 7
Hello,

I want to use the EO Grid for column editing in grid. I tried your example "Edit Grid Data - Excel Style" but when I use postback button I get this error:
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

I'm using EO.Web Controls for ASP.NET (2017) Developer License vers. 17.2.43.0 with .NET Framework 3.5. Can you give me some advice what can I do. Which can be the problem, maybe this error appears because I'm using .NET Framework 3.5 instead of 4.0?

Thank you!
Mihaela Lungu
eo_support
Posted: Friday, November 2, 2018 9:56:18 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

Do you see this problem in our EOWebDemo application or in your application?

Thanks!
Mihaela Lungu
Posted: Friday, November 2, 2018 10:49:29 AM
Rank: Newbie
Groups: Member

Joined: 10/18/2017
Posts: 7
eo_support wrote:
Hi,

Do you see this problem in our EOWebDemo application or in your application?

Thanks!


Hi,

The problem is in my application.

Thank you.
eo_support
Posted: Friday, November 2, 2018 11:38:38 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
This usually has to do with dynamic control creation. So you can verify if that's the problem first by using a static control instead of one created dynamically. Since this is a generic ASP.NET programming issue, we do not provide support on such issues. You can see here for more information about this issue in the following link or search online:

https://msdn.microsoft.com/en-us/library/hbdfdyh7.aspx

If that's not the problem, you can try to isolate the problem into a test project and send the test project to us. See here for more information on how to send test project to us:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks

Mihaela Lungu
Posted: Friday, November 2, 2018 1:51:27 PM
Rank: Newbie
Groups: Member

Joined: 10/18/2017
Posts: 7
Hi,


When I'm using the example in a web form which is not derived from a master page the code is working with no problem. When I'm using the code into a web form derived from a master page I receive "Failed to load view state" error. I do not use dynamic controls in master page.

Thank you for your response.
eo_support
Posted: Friday, November 2, 2018 2:16:47 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

In that case you can create a test project and send the test project to us. Once we have that we will investigate further. Without that it's hard for us to speculate exactly what's going on.

Thanks!
Mihaela Lungu
Posted: Friday, November 2, 2018 2:40:02 PM
Rank: Newbie
Groups: Member

Joined: 10/18/2017
Posts: 7
Hi,

I found which is the problem but it is very weird. When I remove the css link from master page
<link href="../css/test.css" rel="stylesheet" type="text/css" /> the postback is working and I don't receive the error.
I will create a test project and send it to you.

Thanks!
eo_support
Posted: Friday, November 2, 2018 2:49:10 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
That is indeed strange. Please send the test project to us and we will look into it as soon as we have it.
Mihaela Lungu
Posted: Monday, November 5, 2018 6:19:20 AM
Rank: Newbie
Groups: Member

Joined: 10/18/2017
Posts: 7
Hello,

I didn't send you a test project because I found what was the problem in the css:

html, body, form {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
height: 100%;
}
If I remove the above css and use the next one:
html, body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
height: 100%;
}
the error doesn't occur anymore.
Any idea? It is very strange of course... but I'm content that I discover which the problem is and I can use the eo:grid control.

Thank you so much for the support!
eo_support
Posted: Monday, November 5, 2018 5:16:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

We tested these styles here with the Grid and we are not able to reproduce the problem. So we are not sure what to tell you. If you have a test application that you can use to reproduce the problem please send it to us and we will be happy to take a look.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.