dummyagain
December 25th, 2006, 11:09 PM
I have written a button, clicking on it will make the textarea visible.
The following code will work.
protected void exportHTML_Click(object sender, EventArgs e)
{
htmlArea.Visible = true;
}
However, the textarea cannot be shown in the following code
protected void exportHTML_Click(object sender, EventArgs e)
{
htmlArea.Visible = true;
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.htm");
Response.Charset = "";
Response.ContentType = "text/html";
StringBuilder SB = new StringBuilder();
System.IO.StringWriter stringWrite = new System.IO.StringWriter(SB);
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
gvTopic.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
I would like to know why the second code cannot show the text area.. the file generation code should not able to affect that i think .
Thank you
The following code will work.
protected void exportHTML_Click(object sender, EventArgs e)
{
htmlArea.Visible = true;
}
However, the textarea cannot be shown in the following code
protected void exportHTML_Click(object sender, EventArgs e)
{
htmlArea.Visible = true;
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.htm");
Response.Charset = "";
Response.ContentType = "text/html";
StringBuilder SB = new StringBuilder();
System.IO.StringWriter stringWrite = new System.IO.StringWriter(SB);
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
gvTopic.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
I would like to know why the second code cannot show the text area.. the file generation code should not able to affect that i think .
Thank you