In classic ASP.NET Web Forms view engine, we can set the ContentType in the .aspx page to the desired type.
Is there a direct/recommended equivalent in Razor?
In classic ASP.NET Web Forms view engine, we can set the ContentType in the .aspx page to the desired type.
Is there a direct/recommended equivalent in Razor?
Use this:
That will work I just tested it, you can also add the following line to your cshtml:
so that it looks something like this:
It just depends on where you prefer to make the change.
You should set a different content type in your action method.