I have a requirement where I am building a HtmlHelper extension, which will render code articles:
class Article
{
public string Title { get; set; }
public string Description { get; set; }
public string ViewName { get; set; }
}
So far I can get it to render the title and description correctly, but how do I load the HTML from the view into my helper and render that too?
Example of how the helper works:
public static Article(this HtmlHelper helper, Article article)
{
return $"<h1>{article.Title}</h1>";
//...need to load/append View HTML as well before returning
}
HtmlHelperextension methods returnMvcHtmlString. Its not clear what your trying to do here.