I've a mvc4 project where no index.cshtml or layout.cshtml is specified. It should be returned in a action of a api controller. I've only the index.cshtml (its a single page application). How can i get the rendered view as string. I don't use any Controller
, just ApiController
.
Example :
[System.Web.Http.HttpGet]
public string Index()
{
return Razor.Parse(HttpContext.Current.Server.MapPath("~/Views/index.cshtml"));
}