We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Client side script is ignored after saving Excel

Thread ID:





100264 Jul 20,2011 08:01 PM UTC Jul 22,2011 09:49 AM UTC ASP.NET Web Forms (Classic) 2
Tags: XlsIO
Megumi Takahashi
Asked On July 20, 2011 08:01 PM UTC


I am saving error logs on an Excel file and let the user save it by using XlsIO.IWorkbook.SaveAs(...) function with the dialog. After that I create a script to display an alert window with an error message by using ScriptManager.RegisterClientScriptBlock(...) function. At the same time, I change a text control's text to display the error message as well. However, this script and text change are both ignored (not executed), and there is no postback either. Is there any reason why the code after the save is not working and there is no postback? Or is it my code?

-- Saving the excel workbook
objExcelWorkbook.SaveAs(strFile & ".xls", ExcelSaveType.SaveAsXLS, objResponse, ExcelDownloadType.PromptDialog)

-- Creating the script
ScriptManager.RegisterClientScriptBlock(pgPage, pgPage.GetType(), "Message", "window.alert(" & """" & strMessage.Replace(".", "").Replace(vbCrLf, " ") & """" & ");", True)

-- Changing text
With ctlError
.Text = strMessage
End With

(These 3 piece of code appear in different functions.)

Thanks in advance.

Jawahar Jeevanandan J [Syncfusion]
Replied On July 21, 2011 03:54 PM UTC

Hi Megumi,

Thank you very much for using syncfusion products.

Currently we are creating the samples using the information provided in the last post. We will get back with the analysis details in one business day(i.e., July 22 2011).

Please let us know if you have any clarifications.


Jawahar Jeevanandan J [Syncfusion]
Replied On July 22, 2011 09:49 AM UTC

Hi Megumi,

Thank you very much for your patience.

It is the default behaviour of our XlsIO. While saving the file we will be closing the response inorder to avoid the threadabort exception thrown in the application level for excel 2007 and 2010. Similarly the response will be flushed for excel 2003.

We have added the custom method to meet your requirement.I have attached the tested sample for the same along with this update. Please try this sample and let us know whether this helps you.

Please let us know if you have any clarifications.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon