Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Server cannot append header after HTTP headers

Server cannot append header after HTTP headers

Scheduled Pinned Locked Moved ASP.NET
databasehelpjavascriptsysadmintools
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    balu12345
    wrote on last edited by
    #1

    Hi All, In my Webpage i have a Button control. On the button Click i have following functionalities **1.**To show the "progress bar" Icon during retrieving data from Sqlserver Database.. **2.**After retrieving a Data from DB a csv report will be generated. For Point 1--the below is the code i have used Code snippet for busy Icon: ============================ Response.Write("<div ID='mydiv' STYLE='position:absolute;z-index:5000;top:0;left:0;width:100%;height:100%;'><table cellspacing='0' cellpadding='0' border='0' align='center'><tr><td class='copy' align='right' height='260'><img src='./processingimage.gif' width='0' align='absmiddle'></td></tr><tr><td class='copyblack' style='font-family:arial;font-size:14px' align='center'><img src='./processingimage.gif' border='0' align='absmiddle'><br><br>" + strBusyMessage + "<br>" + strReportCreteria + "</td></tr></table>") Response.Write(" ") Response.Write("</div>") Response.Write("<script> var mydiv = document.getElementById('mydiv');</script>") Response.Write("<script language=javascript>") Response.Write("function StartShowWait(){mydiv.style.visibility ='visible';}") Response.Write("function HideWait(){mydiv.style.visibility = 'hidden';}") Response.Write("StartShowWait();</script>") 'Page.Session.Add("SessionID", Session.SessionID) Response.Flush() ================================= For point 2: please see the below code snippet Code snippet to generate CSV report. ================================================== Response.AddHeader("Content-Disposition", "attachment; filename=" + CSVName) Response.ContentType = "application/csv" Response.Write(CSVContent) Response.Flush() Response.Close() ===================================================== when coming to above mention code line(bold one in above snippet) i am getting the below error "Server cannot append header after HTTP headers have been sent" Please help me in resolving the above error.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups