Shawn Mclean
Shawn Mclean

Reputation: 57469

ASP.NET MVC Response file should not download

I am generating a .cxml file on the server and pushing it to the browser based on certain queries. If I just link to a .cxml, it does what I expected and opens it in the respective application.

How can I generate a file and push it to the browser just like if it was linked to a file without it asking me to download it?

The link looks something like:

http://localhost/MyController/GetFile?q=TheQueryStringParam

Thanks.

Upvotes: 1

Views: 424

Answers (1)

tsinik
tsinik

Reputation: 503

Simply Response.Write(yourFileText) should do the trick

Upvotes: 1

Related Questions