Switching between worksheets when EnableSession = False


#1

I am trying to use the Aspose.Excel.Web control in the session-less mode. Basically, as soon as the user clicks on the tick mark or the save icon, the changes get immediately written to an Excel file. I am using Load and OnAfterDataUpdated event handlers for this purpose. This setup works well with single-sheet spreadsheets. However, when I try to manipulate multi-worksheet spreadsheets, as soon as I switch to any non-default worksheet, I get a blank spreadsheet. Is there a way to find out which spreadsheet was clicked. Is there a ViewState variable for this purpose? I did not see any event handler that could be used in this case. I tried using the ActiveSheetIndex property, but it didn't work in this case, probably because it uses Session variables to store the information.

If possible, I would also like to get a complete list of ViewState variables or form values that could be used to read the information between the postbacks. I would like to better understand what information is stored only in session variables and it not available when EnableSession = False. So far I haven't been able to locate such information in the documentation.

I appreciate your help.

Yuriy


#2

Hi,

When the EnableSession property is set to false, you should load excel file in the webform's load event(Page_Load) and save excel file in the OnAfterDataUpdated(with version1.4.4, use SubmitCommand/SaveCommand event instead). Current version doesn't save/load the ActiveSheetIndex when export/import excel files. This issue will be fixed in the next 1.4.5 version. You may write the ActiveSheetIndex to the control's ViewState in the SheetTabClick event(1.4.4) and load it in the Page_Load event.


#3

Henry:

I appreciate your help and prompt reply. The recommended procedure using the SheetTabClick event has completely resolved my problem. Thanks again.

Yuriy