Free Support Forum - aspose.com

ViewState fields are lost on GridWeb tab button click

Hi,

I made a very simple application to illustrate my problem. I have a page with a GridWeb and a button. At the page_load fonction, I set a Viewstate field with a value.

Each time I click on my button it calls a server side function and my viewstate field is conserved. However when I click on the Gridweb tab button, my viewstate field is deleted and so the value of it is null.

I do not want to set my viewstate field each time the page_load function is called. I just want to know if there is something to do to keep my ViewState field until the user closes the page even if he clicks on some GridWeb buttons. I tried to set the GridWeb EnableAjax attribute to true but unfortunatly it doesn’t work.

I attached you a sample project to illustrate the problem. You just have to click on the button and then on the gridweb tab button and observe the trace on the VS output window.

I hope you will help me.

Best Regards,
Romain

Hi,

Thanks for your posting and using Aspose.Cells for GridWeb.

We have logged this issue in our database for investigation. We will look into it and help/advise you asap.

Please also download and try the latest version:
Aspose.Cells
for GridWeb v2.7.11.2000

and let us know your feedback.

This issue has been logged as CELLSNET-41119.

Hi,

We have looked into your issue and found out that it is not a bug of Aspose.Cells for GridWeb.

ViewState is a hidden field in the page that is encoded. Unless you send that information back to the server in your AJAX call, it will never be available, as the server does not store ViewState.

If, instead, you store items in session, you can pull them later, but if you cannot insert everything in session then you can just use it with AJAX.

In our product, if user sets Gridweb attribute EnableAJAX to False, and click on the Gridweb tab button, it will do a FULL postback, the viewstate field is conserved.

While if user set Gridweb attribute EnableAJAX to True, and click on the Gridweb tab button, it will do an AJAX postback, the viewstate field is not conserved.