Display a file on Link Button Click.
protected void linkbtnFile_Click(object sender, EventArgs e)
{
string link = Server.MapPath(".") + "\\
Response.ContentType = "application/"+linkbtnFile.Text.Substring(linkbtnFile.Text.IndexOf('.')+1);
Response.AppendHeader("Content-Disposition", "attachment; filename=" + link);
Response.TransmitFile(link);
Response.End();
}
Export a File from Radgrid to Excel file.
protected void btnExport_Click(object sender, EventArgs e){
RadGrid1.MasterTableView.ExportToExcel();
RadGrid1.ExportSettings.ExportOnlyData = true;
RadGrid1.ExportSettings.IgnorePaging = true;
RadGrid1.ExportSettings.OpenInNewWindow = true;
}
No comments:
Post a Comment