user687554
user687554

Reputation: 11151

Write File as Response in C# in ASP.NET

I have an ASP.NET Web Forms app written in C#. On one of the screens, the user can click a button. When that button is clicked, I need to generate some XML and open it in a custom app. I'm trying to understand how I can take the XML that I have generated, and automatically open the app that can understand it.

The app that uses this XML is a custom app. This app uses a proprietary file format. The file is really just XML. But, I've noticed that the file extension is .ctm.

Is there a way for me to just open this XML in the custom app when someone presses the button in my ASP.NET web form?

Thank you!

Upvotes: 2

Views: 304

Answers (2)

Anri
Anri

Reputation: 6265

You can't do that without involving active-x, or browser plugins, than you'll have a compatibility issues (need to have different plugins for each browser and so on).

Upvotes: 1

Jorge Alvarado
Jorge Alvarado

Reputation: 2674

You can't control with which application your file is opened in your clients machine, but regarding the title of your question, you can just write the xml file and change your content-type to text/xml, if your client os correctly configured it will open your xml with the specified application.

Upvotes: 1

Related Questions