开发者

C#.NET Problem with locking of page after writing stream to window

开发者 https://www.devze.com 2022-12-29 20:56 出处:网络
The code below works fine, the problem is the 1st two lines are appearing on screen. It basically loads the PDF but I can\'t see the btnAcceptProposal change name or become enabled. Tried a Thread for

The code below works fine, the problem is the 1st two lines are appearing on screen. It basically loads the PDF but I can't see the btnAcceptProposal change name or become enabled. Tried a Thread for the load but it broke. Anyone got any ideas - i开发者_如何学Ct's a web application

protected void btnPDFProposal_Click(object sender, EventArgs e)
{    
        btnAcceptProposal.Enabled = true;
        btnAcceptProposal.Text = "sss";

        byte[] p = Order.Proposal;
        Response.AppendHeader("content-disposition", "attachment; filename=Proposal.pdf");

        Response.ContentType = "Application/pdf";
        Response.Clear(); 

        Response.BinaryWrite(p);
        Response.End();
}


You are simply squirting out a PDF file in your responserather than doing a normal postback so where/how/when are you expecting btnAcceptProposal to change?

0

精彩评论

暂无评论...
验证码 换一张
取 消