Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 642891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:13:24+00:00 2026-05-13T21:13:24+00:00

Long story short, I have an ASP.NET application I’m trying to debug and at

  • 0

Long story short, I have an ASP.NET application I’m trying to debug and at some point, in very particular circumstances, the application will throw exceptions at a Response.Redirect() stating:

"Cannot redirect after HTTP headers have been sent."

Which I more or less get, except that I cannot figure out where the headers were sent.

Is there something to look for in an ASP.NET application that will indicate that the HTTP headers have been sent?

BONUS DIFFICULTY: The ASP.NET app is still in .NET 1.1. The circumstances regarding the delay behind the upgrade are a really sore subject.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:13:24+00:00Added an answer on May 13, 2026 at 9:13 pm

    HttpApplication has an event PreSendRequestHeaders which is called just when headers are writtne. Subscribe to this and log it or add a breakpoint.

    Beyond that, HttpResponse has a internal property called HeadersWritten (_headersWritten field in .NET 1.1). Since it’s internal you can’t access it directly, but you can through reflection. If this is only for internal debugging (i.e., not production code), then it’s be fine to use reflection.

    Check this method before/after all the page lifecylce events. Once you know which event is writing out the headers, add more HeadersWritten checks to find out where they’re getting written. Through progressive narrowing of checks to this property, you’ll find it.

    New info

    HeadersWritten property is public starting from .Net 4.5.2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Long story short -- we have 2 webservers that run a 3rd party asp.net
So long story short, i have some forms (2) of them that, need different
Hey, long story short I have inherited some terrible code. As a result a
I have some markup which contains the firebug hidden div. (long story short, the
Long story short, I am trying to build a very bare bones UDP SKB
Long story short, VSS decided I wasn't allowed to have some code changes. I
Very long story short, I have a need to place a WinForms Panel and
Long story short: I have a BDC application definition in my sharepoint 2007 server,
Long story short, I have a substantial Python application that, among other things, does
I have complicated query over very big table. Long story short, when I use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.