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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:53:41+00:00 2026-06-01T08:53:41+00:00

I have a C# ASP webpage that is creating a KML document, and it’s

  • 0

I have a C# ASP webpage that is creating a KML document, and it’s working fine. It’s generating all the locations properly. The problem is that, as it generates the file, it appends the entire web source code to the file.

Below is the beginning of the code that generates the file, and I’m guessing the problem is somewhere there.

context.Response.ContentType = "application/vnd.google-earth.kml+xml";
context.Response.AddHeader("Content-Disposition", "attachment;      
filename=Results.kml");          
XmlTextWriter kml = new XmlTextWriter(context.Response.OutputStream,  System.Text.Encoding.UTF8);          
kml.Formatting = Formatting.Indented;         kml.Indentation = 3;              
kml.WriteStartDocument(); 

Thank you for your help.

  • 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-06-01T08:53:43+00:00Added an answer on June 1, 2026 at 8:53 am

    You need to close response stream after document is written there. It can be done by calling Response.CompleteRequest()

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

Sidebar

Related Questions

I have a webpage in ASP.NET 3.5 that will be creating WebControls dynamically. The
I have an asp.net webpage that only contains a textbox and a button. The
I have an ASP.NET 4 webpage that contains an update panel which just allows
I have a classic asp webpage written in vbscript that outputs the results from
I have a webpage (ASP.NET C#) that has a button: <asp:Button ID=btnHide runat=server OnClick=HidePanel
I'm experiencing a very strange problem... I have a regular ASP.Net webpage with a
We have an asp.net webpage that uses viewstate. During a lengthy operation (that takes
I have an ASP.NET webpage that is rendering many (~3000) <input type=text> textboxes on
Scenario: You have an ASP.Net webpage that should display the next image in a
i have a asp.net mvc webpage that queries a SQL server database for contact

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.