Friday, June 15, 2012

Failed to post back after export file sharepoint

In Sharepoint if you implement functionality to generate report in new .doc or .excel or any other office file in button click.


Issue : You cannot generate report multiple times because after first click on Genrate report button your form post backs will be blocked automatically.

To overcome this issue you need to add a simple Javascript code in page load for the button. Please find the below ;



this.btnGenerateReport.OnClientClick = "_spFormOnSubmitCalled = false;_spSuppressFormOnSubmitWrapper=true;";

                            -or -

this.btnGenerateReport.OnClientClick = "javascript:History.Back()";


No comments:

Post a Comment