Click here to Skip to main content
15,899,026 members

Comments by Von Justine Napalang (Top 5 by date)

Von Justine Napalang 19-Aug-19 21:15pm View    
no worry solve just need to do full post back , by the way thankyou
Von Justine Napalang 19-Aug-19 19:24pm View    
why youtube tutorials code look like this and it work
Von Justine Napalang 19-Aug-19 19:18pm View    
my code looks like this now
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.Buffer = false;
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
HttpContext.Current.Response.AddHeader("Content-Disposition", string.Format("attachment;filename = trans.xls"));
HttpContext.Current.Response.Charset = "";

dgv.DataSource = dt;
dgv.DataBind();
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter hsw = new HtmlTextWriter(sw))
{

dgv.RenderControl(hsw);
HttpContext.Current.Response.Output.Write(sw.ToString());
HttpContext.Current.Response.Flush();
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
}

but still nothings happens. can you guid me with this? im stuck in this for 3 days
Von Justine Napalang 19-Aug-19 18:56pm View    
sorry i dont understand what you mean im kinda new in programming
Von Justine Napalang 19-Aug-19 18:50pm View    
sorry i did not understand what you mean im kinda new in asp.net