Click here to Skip to main content
15,917,481 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: web form using javacript Pin
F-ES Sitecore17-Aug-16 22:48
professionalF-ES Sitecore17-Aug-16 22:48 
RantRe: web form using javacript Pin
Richard Deeming18-Aug-16 1:48
mveRichard Deeming18-Aug-16 1:48 
GeneralRe: web form using javacript Pin
Richard MacCutchan18-Aug-16 2:34
mveRichard MacCutchan18-Aug-16 2:34 
AnswerRe: web form using javacript Pin
Richard MacCutchan18-Aug-16 2:32
mveRichard MacCutchan18-Aug-16 2:32 
QuestionHow to create a Join, or place a datatable within a datatable for ReportViewer Pin
jkirkerx17-Aug-16 7:38
professionaljkirkerx17-Aug-16 7:38 
Questionhow to encrypt and decrypt the file through pkcs Pin
Member 1268779015-Aug-16 23:42
Member 1268779015-Aug-16 23:42 
AnswerRe: how to encrypt and decrypt the file through pkcs Pin
Kornfeld Eliyahu Peter16-Aug-16 2:25
professionalKornfeld Eliyahu Peter16-Aug-16 2:25 
QuestionVS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Usman ali15-Aug-16 19:37
Usman ali15-Aug-16 19:37 
SuggestionRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Richard MacCutchan15-Aug-16 21:28
mveRichard MacCutchan15-Aug-16 21:28 
GeneralRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Usman ali15-Aug-16 21:57
Usman ali15-Aug-16 21:57 
GeneralRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Richard MacCutchan15-Aug-16 22:37
mveRichard MacCutchan15-Aug-16 22:37 
GeneralRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Kornfeld Eliyahu Peter16-Aug-16 0:29
professionalKornfeld Eliyahu Peter16-Aug-16 0:29 
GeneralRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Usman ali16-Aug-16 19:46
Usman ali16-Aug-16 19:46 
SuggestionRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Kornfeld Eliyahu Peter16-Aug-16 20:06
professionalKornfeld Eliyahu Peter16-Aug-16 20:06 
GeneralRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Usman ali24-Aug-16 22:27
Usman ali24-Aug-16 22:27 
QuestionAsp.net C# Export to excel stop working Pin
BigLitz15-Aug-16 6:57
BigLitz15-Aug-16 6:57 
Hello,

I have very perplexing issue. For years I have made websites with Asp.net and have used some lines of code to export gridview data to an excel work sheet. Last week the code just stopped working, I did not change anything with the code to any of the points in my website that exports to excel, it just stopped working.

I have tested it on both my development server and production server, same thing. It still pops up an excel link but when you open the excel file there is nothing, and it doesn't even generate a blank workbook.

Here is the code I use:

public static void DGToExcel(System.Web.UI.Control ctl)
{
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=Excel.xls");
HttpContext.Current.Response.Charset = "UTF-8";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
HttpContext.Current.Response.ContentType = "application/ms-excel";
// ctl.Page.EnableViewState = false;
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
ctl.RenderControl(hw);
HttpContext.Current.Response.Write(tw.ToString());
HttpContext.Current.Response.End();
}

public override void VerifyRenderingInServerForm(Control control)
{

}

I have absolutely no idea what is going on here and why code I have been using for years would stop working. If someone could shed some light on this issue I would grealt appreciate it. Thanks.

Marc
AnswerRe: Asp.net C# Export to excel stop working Pin
Richard Deeming15-Aug-16 7:41
mveRichard Deeming15-Aug-16 7:41 
GeneralRe: Asp.net C# Export to excel stop working Pin
BigLitz15-Aug-16 13:14
BigLitz15-Aug-16 13:14 
Questionhow to make delete row from table using linq Pin
ahmed_sa14-Aug-16 7:20
ahmed_sa14-Aug-16 7:20 
AnswerRe: how to make delete row from table using linq Pin
John C Rayan16-Aug-16 1:30
professionalJohn C Rayan16-Aug-16 1:30 
QuestionTrying to EDIT 2 separate, one-to-one database tables with ONE form/ViewModel Pin
TheOnlyRealTodd11-Aug-16 20:32
professionalTheOnlyRealTodd11-Aug-16 20:32 
AnswerRe: Trying to EDIT 2 separate, one-to-one database tables with ONE form/ViewModel Pin
F-ES Sitecore12-Aug-16 0:34
professionalF-ES Sitecore12-Aug-16 0:34 
QuestionPrintPageEventHandler not working when I upload my site to IIS Pin
awinash kr6-Aug-16 19:21
awinash kr6-Aug-16 19:21 
QuestionRe: PrintPageEventHandler not working when I upload my site to IIS Pin
Richard MacCutchan6-Aug-16 20:24
mveRichard MacCutchan6-Aug-16 20:24 
AnswerRe: PrintPageEventHandler not working when I upload my site to IIS Pin
awinash kr6-Aug-16 20:28
awinash kr6-Aug-16 20:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.