Enable Post back for button after downloading file (Response.write) in SharePoint

If you are using custom code to download file(i.e if you are using response.write in your web part), post back gets disabled for the button. hence we can not download 2nd time without refreshing the page.

To avoid such problem, just add below script in the page using script editor web part.

<script type=”text/javascript” language=”javascript”>  

if (typeof (_spBodyOnLoadFunctionNames) != ‘undefined’ && _spBodyOnLoadFunctionNames != null) {

_spBodyOnLoadFunctionNames.push(

“supressSubmitWraper”);

}

function supressSubmitWraper() {

_spSuppressFormOnSubmitWrapper =

true;

}

</script>

About Prasanta Barik

Hello
This entry was posted in SharePoint and tagged . Bookmark the permalink.

Leave a comment