How can i display an alert after Response.End
<p>I already know, codes after the <code>Response.End()</code> will not work. I am trying to <code>alert</code> a <code>message box</code> after <code>Response.End</code>. Basically what i am doing is i will read data from <code>Excel</code> file and check for the missing data in the excel file. I will collect all the data that was missing from the <code>Excel</code> file and write them all to a <code>text</code> file and will prompt that using the following code</p>

<pre><code>string strPath = Server.MapPath("ErrorLog") + "\\" + "ErrorLog.txt";
string FileName = "Errorlog" + ".txt";
string[] createText = { sb.ToString() };
File.WriteAllLines(strPath, createText);
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + "");
strPath.Length.ToString());
HttpContext.Current.Response.ContentType = "application/text";
HttpContext.Current.Response.WriteFile(strPath);
HttpContext.Current.Response.End();
</code></pre>

<p>After this i would like to display an alert box saying some thing like <code>Invalid Data</code>. But i would like to know how can i do that after <code>Response.End</code></p>

<p>// Updated code as per <code>lcarus</code></p>

<pre><code>string strPath = Server.MapPath("ErrorLog") + "\\" + "ErrorLog.txt";
string[] createText = { sb.ToString() };
File.WriteAllLines(strPath, createText);
ClientScriptManager CSM = Page.ClientScript;
string strconfirm = "&lt;script&gt;if(window.confirm('Excel file has Invalid data.')){window.location.href='/Excel1/ErrorLog/ErrorLog.txt'}&lt;/script&gt;";
 CSM.RegisterClientScriptBlock(this.GetType(), "Confirm", strconfirm, false);
</code></pre>
