I am trying to change the content type of my response from "text/html" to "text/xml" I thought adding Response.ContentType = "text/xml"; Response.AppendHeader("myTestHeader", "pleaseWork"); to my controller would do the job. myTestHeader is correctly added
to the response headers, but the content-type header is still "text/html" Am I setting the content type in the wrong place? Or is the content-type header being reset sometime after my controller calls RenderView(...)?
I believe, but I could be mistaken, that RenderView actually kicks off the normal asp.net pipeline, albeit a smaller and shorter pipeline than webforms. So it is probably getting between your controller and view.
Take sergio's advice and try changing it in the view.
edtd
Member
1 Points
2 Posts
Changing the Response.ContentType
Dec 22, 2007 10:35 PM|LINK
sergiopereir...
Member
227 Points
61 Posts
Re: Changing the Response.ContentType
Dec 22, 2007 11:38 PM|LINK
Headers qualify as UI logic. I'd try doing that in the code-behind of your view page.
Sergio Pereira
http://devlicio.us/blogs/sergio_pereira/
abombss
Member
575 Points
164 Posts
Re: Changing the Response.ContentType
Dec 23, 2007 12:23 AM|LINK
I believe, but I could be mistaken, that RenderView actually kicks off the normal asp.net pipeline, albeit a smaller and shorter pipeline than webforms. So it is probably getting between your controller and view.
Take sergio's advice and try changing it in the view.
edtd
Member
1 Points
2 Posts
Re: Changing the Response.ContentType
Dec 23, 2007 04:05 AM|LINK