2013-06-05 58 views
0

我有一個網頁,其中的數據將按鈕單擊導出。在asp.net中導出數據後顯示一條消息

一旦導出完成,我需要將消息顯示爲「導出成功」。

但導出消息不顯示後...

我的代碼:

protected void btnGenReport_Click(object sender, EventArgs e) 
{ 
     System.IO.StringWriter tw = new System.IO.StringWriter(); 
     System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw); 
     hw.WriteLine("Sample Text"); 
     Response.ContentType = "application/vnd.ms-excel"; 
     Response.AddHeader("Content-Disposition", "inline;filename=\"Sample.xls\""); 
     Response.Write(tw); 
     Response.End(); 
     lblMessage.Text = "Exported Successfully"; 
} 

我應該如何顯示消息.....

+0

認沽到Response.End'();'末 – yogi

+0

我想......但沒有用....味精不顯示 – Renuka

回答