If you want to return plain text it would probably be better to use a ContentResult
. This is specifically for returning raw content without going through a view engine and by default it has a content type of text/html
.
See https://stackoverflow.com/a/553952/493650 for more details.