I am working in asp.net MVC & on the view has to show both json & xml content depending on some condition.
I have to change the content type of the page at runtime ie,
if the condition for json is fulfilled then set page contenttype = "text/json"
if the condition for xml is fulfilled then set page contenttype = "text/xml".
I have tried setting default content type on view as
@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" ContentType="text/json"%>
& in controller c
View Complete Post