Thread aborted when doing HttpContext.Current.Response.End

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have written a function to export the datagrid data to excel. In that
function I was calling HttpContext.Current.Response.End() at the end. If I am
doing this, I am getting an exception message "Thread was being aborted". If
I don't do this then it is exporting the whole data instead of just the
datagrid. I am not knowing what might be the problem. Please let me know if
you have any idea

Thnx,
Sridhar.
 
That's just how Response.End() works, it throws a ThreadAbortExxception.
You can't doing anything wrong, but you may. You'll either need to handle
(catch/swallow/hide) the exception or change your page so only the grid
shows and there's no need to End the request.

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top