Disclaimer: I edited the question because i changed the process, but it does not change anything of the problem...
I am trying to get a PartialViewResult
rendered to a string, i tried to use the RenderRazorViewToString
Method from this question render a view as a string..., i got the hint from this qustion mvc return partial view as json
My problem is, the string looks like this:
<$A$><h1>SomeHeader</h1>
<table</$A$><$B$> class="table table-striped"</$B$><$C$>> <tbody</$C$><$D$> data-bind="template: { name: 'eventTemplate', foreach: events }"</$D$><$E$>></tbody>
</table></$E$>
instead of this
<h1>SomeHeader</h1>
<table class="table table-striped">
<tbody data-bind="template: { name: 'eventTemplate', foreach: events }"></tbody>
</table>
Update:
The Process looks like this:
public ActionResult Index(string item, long id)
{
var cont = SomePartialView(item, id);
return View(model: RenderRazorViewToString(cont));
}
now the View just renders the string like this:
@Model
The RenderRazorViewToString(PartialViewResult)
returns this "crippled" string...