こんにちは皆、私はWebアプリケーションを作るためにC#.netを使用しています。 グリッドビューのデータをエクスポートするWebページを作成しています。私のコードはデータをエクスポートする際にボタンの目に見える虚偽の問題
protected void btnexport_Click(object sender, EventArgs e)
{
btnsubmit.Visible = false;
exporttoexcel();
expToExcel();
}
public override void VerifyRenderingInServerForm(Control control)
{
//base.VerifyRenderingInServerForm(control);
}
public void exporttoexcel()
{
Context.Response.Clear();
Context.Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Context.Response.Charset = "";
Context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
Context.Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
GridView1.RenderControl(htmlWrite);
Context.Response.Write(stringWrite.ToString());
Context.Response.End();
}
私のGridViewのデータが正常にExcelへのエクスポートであるが、EXPORTTOEXCELボタンクリックイベントに、私は別のボタンのvisibleプロパティが提出falseにしようとしていますが、私はそれを行うことに成功していますに従うようである私に教えてくださいどのように私は私があなたに、ボタンの可視性を設定している事前
私はbtnexport.Visibleが= falseを推測します。 –