Click here to Skip to main content
15,899,679 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionLooping to find LoginView controls Pin
NoirWD18-Sep-09 3:34
NoirWD18-Sep-09 3:34 
QuestionDatatable Concatination Pin
sekannak18-Sep-09 2:56
sekannak18-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
arkiboys18-Sep-09 2:52 
AnswerRe: Export to Excel Pin
Arun Jacob18-Sep-09 2:57
Arun Jacob18-Sep-09 2:57 
GeneralRe: Export to Excel Pin
arkiboys18-Sep-09 3:53
arkiboys18-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
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 

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.