How do I generate a KML file in ASP.NET?
How do I generate and return a KML document directly to the browser without writing a temporary file to the server or relying on a 3rd party library or class? Mehrdad Afshari I suggest you consider using an HTTP Handler instead of a ASP.NET page. It will be cleaner and more performant. Just add new item of type "Generic Handler" to your project and consider moving the code to its ProcessRequest method. The general approach is good, though. By the way, unless you are explicitly mapping .kml files to an ASP.NET handler, it'll not run anyway. I suggest going with the default .ashx extension and