I just wanna ask how to generate or create textfile, becuase i want to display my data in the database as text.
im using c# in asp.net MVC 3
thank you very much! any answer will be apreciated.
I just wanna ask how to generate or create textfile, becuase i want to display my data in the database as text.
im using c# in asp.net MVC 3
thank you very much! any answer will be apreciated.
You can return plain text from an action by assembling a string and returning
Content(textString, "text/plain")
.If you just want to return some data from the database in a text file that will be downloaded to user's local computer, create an Action in your Controller like in this sample:
then you can create an ActionLink to that action on your View which will trigger file download:
I hope that helps!