解決策を見つけるためにインターネットでほぼ2日間検索しましたが、まだ何も機能していません。
ページに 2 つのユーザー コントロールがあります。最初に AsyncFileUpload が含まれます:
<cc1:AsyncFileUpload runat="server" ID="fuExcelUploader" Width="400px"
UploadingBackColor="#CCFFFF" ThrobberID="myThrobber"
CompleteBackColor="#CEF6CE" />
2番目には、ダウンロードボタン(Excelファイル)のあるテンプレートフィールドを含むグリッドビューがあります
<asp:TemplateField HeaderText="Report with errors" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton id="lbError" CommandName="ErrorClick" runat="server" CommandArgument='<%# Eval("Report.Id") %>' ValidationGroup="other2357"><asp:Image ID="imgReport" runat="server"
ImageUrl="~/App_Themes/Default/Images/icons/page_excel.png" ImageAlign="Middle" Visible='<%# Convert.ToInt32(Eval("Report.Id")) > 0 %>' /></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
RowCommand if e.CommandName = ErrorClicked ファイルをダウンロードするためのコードがあります
Response.Clear();
Response.Buffer = true;
Response.AddHeader(
"Content-Disposition", string.Format("attachment; filename={0}", "Error_report_" + this.ErrorClicked + ".xlsx"));
HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats";
// Response.Cache.SetCacheability(HttpCacheability.Private);
Response.BinaryWrite(value); //value is byte[];
Response.End();
asyncfileupload でファイルをアップロードし、gridview などのアイコンをクリックしてレポートをダウンロードできますが、問題が 1 つあります。
グリッドビューのダウンロード アイコンをクリックするたびに、ファイルのダウンロード ダイアログがポップアップし、保存/開く/キャンセルできますが、何をしても、asyncfileupload で新しいファイルをアップロードしようとすると、同じ RowCommand イベントが同じ 'ErrorClick' CommandName で発生し、 CommandArgument であるため、ファイルを再度ダウンロードするウィンドウが表示されます (ページはロックされています)。linkbutton も asyncfileupload もページ全体を更新しないためかもしれません (同じポストバックですか?)。
asyncfileupload コントロールを使用したアップロード中に rowcommand が起動される理由、またはその問題を解決する方法を知っていますか。この場合、udpatepanels は使用しません。