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 6766417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:49:41+00:00 2026-05-26T14:49:41+00:00

i am sending a large amount of excel content data to the browser using

  • 0

i am sending a large amount of excel content data to the browser using Page.Response.Write(“”) in a for loop.

before starting the loop i am changing the conetnt type of the reponse.context property to “ms-excel”.

if i have an exception during that for loop , i try to popup an error message to the browser by registering an HTML startup script block and Write it to the browser. before the write i change back the content type to be text/html.
but i get an error that say that is not possible to change the content type after sending the HTTP Headers.

How to notify the browser about an error that occured during that for loop?
Is it possible to have more that one respone to the same browser tab?
by the way,right now i don’t want to use ASP.NET AJAX.

  • 1 1 Answer
  • 0 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-26T14:49:42+00:00Added an answer on May 26, 2026 at 2:49 pm

    Did you try Response.ClearHeaders(); before changing the context type?

    If that doesn’t work because your Response.Write is causing problems, you might think about going the route of building a string before deciding your content type and then setting the headers.

    • Loop trough the content and add to a StringBuilder
    • If no error, set contenttype to ms-excel and write out SB
    • If there is an error, leave contenttype as it is write out your error message as needed.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sending a large amount of data in one go between a client and
I've got a large amound of data I'm sending down to the client using
I have a large amount of data to move using two PHP scripts: one
Using PL/SQL, what are good options for sending large amounts of data to client
I'm trying to send a large amount of data (more than 50 MB) using
This pertains to Linux kernel 2.6 TCP sockets. I am sending a large amount
I am reading a very large file using a NSInputStream and sending them to
When sending data over HTTPS, I know the content is encrypted, however I hear
We're working on an app that streams a large amount of data out via
I am currently sending large amounts of data over a Java socket, and I

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.