Click here to Skip to main content
15,922,696 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Export to Excel Pin
Abhishek Sur18-Sep-09 5:23
professionalAbhishek Sur18-Sep-09 5:23 
QuestionError while transferring data to Excel Pin
nagendrathecoder18-Sep-09 2:04
nagendrathecoder18-Sep-09 2:04 
Hello all,

In my ASP.Net application, i am transferring GridView contents to a excel file. I am using following code:

string attachment = "attachment; filename=MakeList.xls";
            Response.ClearContent();
            Response.AddHeader("content-disposition", attachment);
            Response.ContentType = "application/ms-excel";
            StringWriter sw = new StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);
            GridView1.RenderControl(htw);
            Response.Write(sw.ToString());
            Response.End();


It was working fine, but as soon as i put this code in try-catch block, i am getting this error:
"Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack."

If i remove try-catch block, it again works fine.

Can anyone tell me whats the problem? Am i miising something?

Thanks,
Nagendra.
AnswerRe: Error while transferring data to Excel Pin
Arun Jacob18-Sep-09 2:19
Arun Jacob18-Sep-09 2:19 
GeneralRe: Error while transferring data to Excel Pin
nagendrathecoder18-Sep-09 2:31
nagendrathecoder18-Sep-09 2:31 
AnswerRe: Error while transferring data to Excel Pin
Arun Jacob18-Sep-09 2:33
Arun Jacob18-Sep-09 2:33 
GeneralRe: Error while transferring data to Excel Pin
nagendrathecoder18-Sep-09 2:36
nagendrathecoder18-Sep-09 2:36 
QuestionProblum In Javascript Pin
Sachin Dubey18-Sep-09 1:50
Sachin Dubey18-Sep-09 1:50 
AnswerRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:08
Arun Jacob18-Sep-09 2:08 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:10
Sachin Dubey18-Sep-09 2:10 
GeneralRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:14
Arun Jacob18-Sep-09 2:14 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:19
Sachin Dubey18-Sep-09 2:19 
AnswerRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:23
Arun Jacob18-Sep-09 2:23 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:31
Sachin Dubey18-Sep-09 2:31 
AnswerRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:34
Arun Jacob18-Sep-09 2:34 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:36
Sachin Dubey18-Sep-09 2:36 
Questiondatatable Pin
sekannak18-Sep-09 1:12
sekannak18-Sep-09 1:12 
AnswerRe: datatable Pin
Arun Jacob18-Sep-09 1:21
Arun Jacob18-Sep-09 1:21 
AnswerRe: datatable Pin
Not Active18-Sep-09 2:19
mentorNot Active18-Sep-09 2:19 
Questionhow to create frames in ASP.NET Pin
QuickDeveloper17-Sep-09 22:53
QuickDeveloper17-Sep-09 22:53 
AnswerRe: how to create frames in ASP.NET Pin
nagendrathecoder17-Sep-09 23:01
nagendrathecoder17-Sep-09 23:01 
AnswerRe: how to create frames in ASP.NET Pin
Christian Graus17-Sep-09 23:55
protectorChristian Graus17-Sep-09 23:55 
GeneralRe: how to create frames in ASP.NET Pin
QuickDeveloper18-Sep-09 0:10
QuickDeveloper18-Sep-09 0:10 
GeneralRe: how to create frames in ASP.NET Pin
Christian Graus18-Sep-09 0:13
protectorChristian Graus18-Sep-09 0:13 
Questionset focus in dynamic multiple textbox in repeater Pin
Member 292522517-Sep-09 22:39
Member 292522517-Sep-09 22:39 
AnswerRe: set focus in dynamic multiple textbox in repeater Pin
Christian Graus17-Sep-09 22:45
protectorChristian Graus17-Sep-09 22:45 

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.