Click here to Skip to main content
15,915,042 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi everyone
I try to make a site with a asp.net web application, but I can't continue because, I can not set the value of TextBox to "finish" after the execution of a function file download.
protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TextBox1.Text = "start";
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.ContentType = "application/pdf";            
            Response.AppendHeader("Content-Disposition", "attachment; filename=print_ordre.pdf");
            Response.TransmitFile(Server.MapPath("~/print_ordre.pdf"));
            //Response.End();

            TextBox1.Text = "finish";
        }


I await your help ...
Posted
Updated 21-Oct-13 11:14am
v2
Comments
Richard C Bishop 21-Oct-13 17:15pm    
Why not? Any errors?
nasrsoft 21-Oct-13 17:25pm    
at the end the value of TextBox1 is not "finish"

1 solution

It's not possible , the reason is there are two streams you are trying to write or ASP.NET performs

1. The filedownload
2. The Page response

It's not possible to do both of them. More details please refer this

http://stackoverflow.com/questions/14760154/response-transmitfile-nothing-happening[^]

http://stackoverflow.com/questions/14744981/side-actions-not-happening-after-response-writefile/14745111#14745111[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900