没有控制使用导出为CSV方法后回传 [英] No controls postback after using Export To CSV method
问题描述
随着一些成功,我使用这个建议code 到GridView导出为CSV(或在我区分一个TSV)。
With some success I'm using this suggested code to export a gridview to CSV (or in my case a TSV).
我点击我的按钮时,页面后的背部和TSV交付。太好了。
I click my button, the page post's back and the TSV is delivered. Great.
不过,在那之后回传没有其他控件(带自动回dropdownlists设置为true,按钮 - 一台提交另一个javascript触发回发按钮)。将回发到服务器
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.
可能的线索:在看谷歌Chrome网络选项卡中的POST为CSV被认为是取消
Possible clue: looking at the Google Chrome Network tab the POST for the CSV is considered "Cancelled".
在情况下,他们提供任何帮助,在这里都为CSV的请求和响应头 - 我已经消隐与安全有关的一对夫妇:
In case they offer any assistance, here are the REQUEST and RESPONSE headers for the CSV - I've blanked a couple related to security:
请求:
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}
响应:
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:
- 我在页面上调用驻留在标签的方法(这是一个SharePoint网站,使codebehinds困难)
- 我有一种感觉这是关系到分块下载没有正确关闭,但我不能肯定。
如果需要任何更多的信息,我可以自由地提供它!
If any more info is needed, I'm free to offer it!
推荐答案
最近我有这个问题是一个已知的问题。一些有关SharePoint不允许多个回发。请看下面的链接,这个人是如何解决它。
I have recently had this issue it is a known problem. something about SharePoint not allowing multiple postbacks. Please look at the following link for how this person resolved it.
<一个href=\"http://blogs.msdn.com/b/bspann/archive/2009/06/29/exporting-binary-files-inside-sharepoint-webpart.aspx\" rel=\"nofollow\">http://blogs.msdn.com/b/bspann/archive/2009/06/29/exporting-binary-files-inside-sharepoint-webpart.aspx
至于我是如何解决我的问题,我用DexEx preSS控制和我有一个ASPxButton揭开序幕服务器端code出口电网。我还附上一些javascript code到onClick事件客户端设置下列变量上的 _spFormOnSubmitCalled = FALSE; _spSup pressFormOnSubmitWrapper = TRUE;
As for how I resolved my issue, I used DexExpress controls and I had a ASPxButton to kick off a server side code to export the grid. and I also attached some javascript code to the onClick event on the client to set the following variables _spFormOnSubmitCalled=false;_spSuppressFormOnSubmitWrapper=true;
<dx:ASPxButton runat="server" ID="btnExportGrid" Text="Export Data" AutoPostBack="False" OnClick="btnExportGrid_Click" >
<ClientSideEvents Click="function(s, e) {_spFormOnSubmitCalled=false;_spSuppressFormOnSubmitWrapper=true;}" />
</dx:ASPxButton>
我希望这有助于。
I hope this helps.
这篇关于没有控制使用导出为CSV方法后回传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!