I want to pass in HTML to my partial view, like so:
@Html.Partial("_MyForm", "<button id='foo'>Process Data</button>")
This currently works, but passing in strings is inelegant. Previously, IHTMLString allowed you to do this instead (see link):
public class HTMLViewModel
{
public Func<object, IHtmlString> Content { get; set; }
}
@Html.Partial("_MyForm", new HTMLViewModel()
{
Content =
@<button>
<h1>Hello World</h1>
</button>
})
IHTMLString no longer exists in .NET Core, can the approach still be replicated with some other feature?