In my asp.net core 2.0 application, I need to show the details of a payment receipt as a view to the user. I also need to send to user the same html text as an email (minus the top navigation bar).
My thought was to put the payment details in a partial view. I can then use this partial view on the website as well as in the email.
In appears Html
object is injected into razor pages automatically such that one can, for example, call @Html.Partial().
Is there a way to use this Html
object from the Controller class? Or, is there a different mechanism to render .cshtml
file into html string? Regards.