protected void word_Click(object sender, ImageClickEventArgs e)
{
grdCategory.AllowPaging = false;
grdCategory.DataBind();
Response.ClearContent();
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "SetaDirectory.doc"));
Response.Charset = "";
Response.ContentType = "application/ms-word";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
grdCategory.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}
No comments:
Post a Comment