I am trying to display contents of a text file in a view. So far I have been able to get the following code for the controller:
public ActionResult ShowFile()
{
string filepath = Server.MapPath("\\some unc path\\TextFile1.txt");
var stream = new StreamReader(filepath);
return File(stream.ReadToEnd(), "text/plain");
}
I do not know how to go ahead with the view.
Kindly advise.