You could use the following in your view for an
index action:
<!--
@model string
<!--
@Html.Raw(Model)
However I believe this should cause an issue when invoking that
index action because a
string
model is causing the path's ambiguity.
As a workaround to this you could cast this
string
as an
object
when passing it to
View and then call
ToString
on your
Model
.
But a better way would be to just use the following:
public ActionResult Index()
{
return View(new HtmlString("<div>hello</div>"));
}
@model HtmlString
@Model