ASP.NET Javascript DoPostBack and SharePoint: Single Postback Issue

18 September 2012

Here's a quick tip (man, there sure has been a lot of SharePoint in my last few posts!)

If you've got a Sharepoint page, and normal postbacks (like paging in your SPGridView or LinkButtons) stop working after you use a __doPostBack() javascript command, try adding the two settings just before your postback:

_spFormOnSubmitCalled = false;
_spSuppressFormOnSubmitWrapper=true; 
__doPostBack('eventtarget', arguments);

Apparently, SharePoint does some viewstate / time / validation / checking which needs to be turned off to prevent your page from dying. I'm sure someone has a much clearer explanation for this out there, for which I'd love to hear - in any case, this fixed my issue so if you're only having one postback going through on your SharePoint page, this is worth a shot!

Tags: asp.net, DoPostback, Javascript, SharePoint

Add a Comment

No Comments