Click here to Skip to main content
14,839,738 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionLooping to find LoginView controls Pin
NoirWD18-Sep-09 3:34
MemberNoirWD18-Sep-09 3:34 
QuestionDatatable Concatination Pin
sekannak18-Sep-09 2:56
Membersekannak18-Sep-09 2:56 
AnswerRe: Datatable Concatination Pin
Abhishek Sur18-Sep-09 5:50
professionalAbhishek Sur18-Sep-09 5:50 
QuestionExport to Excel Pin
arkiboys18-Sep-09 2:52
Memberarkiboys18-Sep-09 2:52 
AnswerRe: Export to Excel Pin
Arun Jacob18-Sep-09 2:57
MemberArun Jacob18-Sep-09 2:57 
GeneralRe: Export to Excel Pin
arkiboys18-Sep-09 3:53
Memberarkiboys18-Sep-09 3:53 
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
Membernagendrathecoder18-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
MemberArun Jacob18-Sep-09 2:19 
GeneralRe: Error while transferring data to Excel Pin
nagendrathecoder18-Sep-09 2:31
Membernagendrathecoder18-Sep-09 2:31 
AnswerRe: Error while transferring data to Excel Pin
Arun Jacob18-Sep-09 2:33
MemberArun Jacob18-Sep-09 2:33 
GeneralRe: Error while transferring data to Excel Pin
nagendrathecoder18-Sep-09 2:36
Membernagendrathecoder18-Sep-09 2:36 
QuestionProblum In Javascript Pin
Sachin Dubey18-Sep-09 1:50
MemberSachin Dubey18-Sep-09 1:50 
AnswerRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:08
MemberArun Jacob18-Sep-09 2:08 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:10
MemberSachin Dubey18-Sep-09 2:10 
GeneralRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:14
MemberArun Jacob18-Sep-09 2:14 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:19
MemberSachin Dubey18-Sep-09 2:19 
AnswerRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:23
MemberArun Jacob18-Sep-09 2:23 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:31
MemberSachin Dubey18-Sep-09 2:31 
AnswerRe: Problum In Javascript Pin
Arun Jacob18-Sep-09 2:34
MemberArun Jacob18-Sep-09 2:34 
GeneralRe: Problum In Javascript Pin
Sachin Dubey18-Sep-09 2:36
MemberSachin Dubey18-Sep-09 2:36 
Questiondatatable Pin
sekannak18-Sep-09 1:12
Membersekannak18-Sep-09 1:12 
AnswerRe: datatable Pin
Arun Jacob18-Sep-09 1:21
MemberArun 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
MemberQuickDeveloper17-Sep-09 22:53 

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.