With some success I'm using this suggested code to export a gridview to CSV (or in my case a TSV).
I click my button, the page post's back and the TSV is delivered. Great.
However, after that postback no other controls (dropdownlists with autopostback set to true and buttons - one submit the other a javascript triggered postback button) will postback to the server.
Possible clue: looking at the Google Chrome Network tab the POST for the CSV is considered "Cancelled".
In case they offer any assistance, here are the REQUEST and RESPONSE headers for the CSV - I've blanked a couple related to security:
REQUEST:
POST /Perspective/SitePages/User_Email_List.aspx HTTP/1.1
Host: as-sharepoint
Connection: keep-alive
Content-Length: 8740
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Origin: http://as-sharepoint
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
Content-Type: application/x-www-form-urlencoded
DNT: 1
Referer: http://as-sharepoint/Perspective/SitePages/User_Email_List.aspx
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: WSS_KeepSessionAuthenticated={xxx}
RESPONSE:
HTTP/1.1 200 OK
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: application/text
Server: Microsoft-IIS/7.5
SPRequestGuid: xxx
Set-Cookie: WSS_KeepSessionAuthenticated={xxx}; path=/
X-SharePointHealthScore: 1
Set-Cookie: WSS_KeepSessionAuthenticated={xxx}; path=/
Content-Disposition: attachment;filename=EmailList.tsv
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 14.0.0.4762
Date: Tue, 19 Mar 2013 13:40:18 GMT
Other bits of possible related information:
- The method I am calling resides in a tag on the page (This is a Sharepoint website which make codebehinds difficult)
- I have a feeling this is related to the chunked download not being closed correctly, but I can't be sure.
If any more info is needed, I'm free to offer it!