protected void SaveBtn_Click(object sender, EventArgs e)
{
try
{
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
Response.AddHeader("content-disposition", "attachment; filename=" + DropDownList1.SelectedItem.Text + "_" + DropDownList2.SelectedItem.Text + "_" + DropDownList3.SelectedItem.Text + "_" + TextBox1.Text + ".xls");
Response.ClearContent();
GridView1.RenderControl(htw);
Response.Write(sw.ToString());
Response.Flush();
Response.End();
}
catch (Exception ex)
{
}
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
}