TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Reylin Mathew
NA
347
75.5k
Downloading a excel File with a Save As Dialog in c#
Nov 23 2018 11:10 PM
i am creating an excel file generate on button click.but after button click their is no display on popup box.
i think jquery file conflict..but their is no jquery file is calling or adding.
this is my code ..
protected void btnGenerate_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable();
gvd_details.DataSource = ex.Getadmindtals(name.SelectedValue);
gvd_details.DataBind();
GridView gv = new GridView();
gv.DataSource = gvd_details.DataSource;
gv.DataBind();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=Details.xls");
string path = Server.MapPath("files\\");
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("content-disposition", "attachment;filename=Details.xls");
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
gv.RenderControl(hw);
Response.Output.Write(sw.ToString());
Response.End();
}
plz help me..!! thnkx in adv..
Reply
Answers (
4
)
Identity - Binding Register/Login methods with my old forms
two different form tags with runat=server in ASP.Net