protected void btnExportToExcel_Click(object sender, EventArgs e)
{
try
{
DataTable dt = student.GetDetails("B.Tech").Tables[0];
DataGrid GridView1 = new DataGrid();
GridView1.DataSource = dt;
GridView1.DataBind();
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", string.Format("attachment; filename=StudentsBTech.xls"));
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView1.GridLines = GridLines.Both;
GridView1.AllowPaging = false;
GridView1.RenderControl(htw);
Response.Output.Write(sw.ToString());
GridView1.DataBind();
Response.Flush();
}
catch (Exception ex)
{
}
finally { Response.End(); }
}
public override void VerifyRenderingInServerForm(Control control)
{ }
MAD Skills Kotlin and Jetpack: wrap-up
-
*Posted by Florina Muntenescu, Developer Relations Engineer *
[image: Kotlin and Jetpack image]
We just wrapped up another series of MAD Skills videos a...
1 week ago