Data table to Excel conversion leaves my server side button non responsive in SharePoint WebPart

Posted by Nikhil Vaghela on Stack Overflow See other posts from Stack Overflow or by Nikhil Vaghela
Published on 2010-04-29T13:00:31Z Indexed on 2010/05/13 5:44 UTC
Read the original article Hit count: 337

Filed under:
|
|

We have a web part on which we display some data in a grid. We are exporting grid's underlying datatable to Excel and displaying Open - Save - Cancel dialouge box on click of a server side button.

Following is the code we are executing on click of server side button.

this.Page.Response.Clear();
this.Page.Response.AppendHeader("Content-Disposition", "attachment; filename=MyTasks.xls");
this.Page.Response.ContentType = "application/ms-excel";
this.Page.Response.Write("...here goes my well formated html....");
this.Page.Response.End();

Problem is that when i click on Cancel in the diaglouge box then dialogue box to Open/Save excel disappears but all the server side buttons placed on my web part becomes non responsive, on click of any of those buttons their server side click event does not get fired !!!

Any idea ?

Thanks.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about sharepoint