put code in button click event
GridView1.AllowPaging = false; GridView1.DataBind();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.ppt");
Response.Charset = "";
Response.ContentType = "application/vnd.ppt";\\\\\for text file write vnd.txt
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite =
new HtmlTextWriter(stringWrite);
GridView1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
GridView1.AllowPaging = true;
GridView1.DataBind();
You will have to override function of VerifyRenderingInServerForm like this
public override void VerifyRenderingInServerForm(Control control)
{
}
And to avoid exception you have to set property of
<![CDATA[<%@ Page Language="C#" EnableEventValidation="false" %>