I'd like to return some XML instead of HTML in my WebMatrix cshtml file? How do you change the content type header?
相关问题
- TextBoxFor decimal
- How to do an inline style with asp.net mvc 3 razor
- Issue with updating model on AJAX “POST”
- Value cannot be null or empty.\r\nParameter name:
- Should one try to guard against null reference exc
相关文章
- Breakpoint in ASP.NET MVC Razor view will not be h
- How to define function that returns html in asp.ne
- MVC 3 Razor - Trigger validation from controller
- Where to configure Razor page language version to
- What is a nice, reliable short way to get the char
- MVC submit button not firing
- How can I use Enums on my Razor page in MVC3?
- how to access querystring in ASP.Net MVC View?
At the top of your Razor file, set the ContentType of the Response object:
If you are using ASP.NET MVC, you can choose to make the change in your action method in the controller, like so:
Use the Response.ContentType property at the top of your .cshtml file then include the XML in the content of the view: