Hey. I am trying to call a RazorEmail template from my controller, as shown below.
public EmailResult TestEmail(EmailModel model) { To.Add(model.Email); From = " test@test.com "; Subject = "Testt Mail"; return Email("EmailTemplate", model); }
in mind that my template is under
~/Views/Template/EmailTemplate.html.cshtml @inherits System.Web.Mvc.WebViewPage @model W2G.Models.EmailModel
First, when I try to access, I have the following error
The view must derive from WebViewPage, or WebViewPage<TModel>.
I got the solutions from here https://stackoverflow.com/a/464632/
But now I get this error. Please kindly help me. It took me a long time
c # asp.net-mvc razor razorengine
Dilip0165
source share