my code is
please give me solution...thank you
bool b = false;
string str=Server.MapPath("~/Files/"+filepath);
// Send the file to the browser
Response.AddHeader("Content-type", filetype);
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.TransmitFile(Server.MapPath("~/Files/" + filepath));
Response.Flush();
// HttpContext.Current.ApplicationInstance.CompleteRequest();
Response.End();
b = true;
This notification means that the thread is currently executing code, and therefore cannot be used to evaluate the expression.
Use
HttpContext.Current.ApplicationInstance.CompleteRequest
Instead of Response.End();
Response.Flush
and Response.End
does the same thing except Response.End
stops execution of the page, and raises the EndRequest
event.
Calls to the End
methods throw a ThreadAbortException
exception when the current response ends prematurely.