Click here to Skip to main content
15,900,254 members
Home / Discussions / C#
   

C#

 
GeneralRe: Plz answer these Pin
yaminilatha2-Apr-07 0:49
yaminilatha2-Apr-07 0:49 
AnswerRe: Plz answer these Pin
Keshav V. Kamat1-Apr-07 22:38
Keshav V. Kamat1-Apr-07 22:38 
GeneralRe: Plz answer these Pin
yaminilatha2-Apr-07 0:50
yaminilatha2-Apr-07 0:50 
QuestionFile copy Pin
N a v a n e e t h1-Apr-07 17:20
N a v a n e e t h1-Apr-07 17:20 
AnswerRe: File copy Pin
joon vh.1-Apr-07 21:46
joon vh.1-Apr-07 21:46 
QuestionSqlDependency and Release Build Pin
Darkness841-Apr-07 17:04
Darkness841-Apr-07 17:04 
AnswerRe: SqlDependency and Release Build Pin
Darkness841-Apr-07 21:36
Darkness841-Apr-07 21:36 
QuestionProblem with “Response.BinaryWrite Pin
tedhill131-Apr-07 14:13
tedhill131-Apr-07 14:13 
It seems that the download dialog triggered by this code
prevents the label control “Label2” to show its message.

What should I change/add to this code in order that the message
"Download Complete" could appear in the web page in the
“Label2” control ?


Here is the relevant code:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

protected void DownlFile_Click(object sender, EventArgs e)
{


string web_path = "./items/X-103.pdf";

string path = Server.MapPath(web_path);

FileStream MyFileStream = new FileStream(path, FileMode.Open);
long FileSize;
FileSize = MyFileStream.Length;
byte[] Buffer = new byte[(int)FileSize];
MyFileStream.Read(Buffer, 0, (int)MyFileStream.Length);
MyFileStream.Close();
Response.ContentType = "application/pdf";

Response.AddHeader
("content-disposition", "attachment; filename= X-103.pdf");

Response.BinaryWrite(Buffer);

Label2.Text = "Download Complete";

}

<asp:Button ID="DownlFile" runat="server" Text="Download The File"
OnClick="DownlFile_Click" />
<br /> <br />
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>

AnswerRe: Problem with “Response.BinaryWrite Pin
Christian Graus1-Apr-07 14:56
protectorChristian Graus1-Apr-07 14:56 
GeneralRe: Problem with “Response.BinaryWrite Pin
tedhill132-Apr-07 0:06
tedhill132-Apr-07 0:06 
QuestionGhosted icon Pin
Sergio Paque1-Apr-07 13:33
Sergio Paque1-Apr-07 13:33 
AnswerRe: Ghosted icon Pin
Judah Gabriel Himango1-Apr-07 16:47
sponsorJudah Gabriel Himango1-Apr-07 16:47 
GeneralRe: Ghosted icon Pin
Sergio Paque2-Apr-07 0:53
Sergio Paque2-Apr-07 0:53 
GeneralRe: Ghosted icon Pin
Insincere Dave2-Apr-07 5:12
Insincere Dave2-Apr-07 5:12 
QuestionAdjusting size in a picturebox Pin
missrej1-Apr-07 10:04
missrej1-Apr-07 10:04 
AnswerRe: Adjusting size in a picturebox Pin
Wayne Phipps1-Apr-07 10:19
Wayne Phipps1-Apr-07 10:19 
GeneralRe: Adjusting size in a picturebox Pin
missrej1-Apr-07 16:52
missrej1-Apr-07 16:52 
QuestionMeasuring total system memory Pin
chatnoir1-Apr-07 9:02
chatnoir1-Apr-07 9:02 
AnswerRe: Measuring total system memory Pin
Wayne Phipps1-Apr-07 10:01
Wayne Phipps1-Apr-07 10:01 
QuestionTo get shortcuts(icons) of documents stored in SQL server [modified] Pin
missrej1-Apr-07 6:30
missrej1-Apr-07 6:30 
AnswerRe: To get shortcuts(icons) of documents stored in SQL server Pin
joon vh.1-Apr-07 21:41
joon vh.1-Apr-07 21:41 
QuestionQuestion on deleting a file once the user closes the application? Pin
Khoramdin1-Apr-07 5:23
Khoramdin1-Apr-07 5:23 
AnswerRe: Question on deleting a file once the user closes the application? Pin
Leslie Sanford1-Apr-07 5:50
Leslie Sanford1-Apr-07 5:50 
Questionfast processing techniques required to process text files greater than 35 GB! Pin
Adeel Chaudhry1-Apr-07 2:38
Adeel Chaudhry1-Apr-07 2:38 
AnswerRe: fast processing techniques required to process text files greater than 35 GB! Pin
DavidNohejl1-Apr-07 4:21
DavidNohejl1-Apr-07 4:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.