MVC view email body assistance

I need help with building an MVC view based off of this html. Can someone help me with this please.

<div>Hello {0},</div>

<div>
	A password reset was requested on your account at {1}.  If you made this request please click <a href="{2}">here</a>.
</div>

<div>
	If this request wasn't submitted by you, you can safely disregard this message.
</div>

When you say an MVC view, are you using some sort of framework to build this application - perhaps a PHP or JavaScript framework? Different frameworks have different ways of building views. In particular, are the views built based on a templating engine? We really need more information from you about what you are working on, and what technologies you are using.

I’m rendering a string view like this in a controller class file

 public static string RenderViewToString(Controller controller, string viewName, object model)
        {
            controller.ViewData.Model = model;
            try
            {
                using (StringWriter sw = new StringWriter())
                {
                    ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView(controller.ControllerContext, viewName);
                    ViewContext viewContext = new ViewContext(controller.ControllerContext, viewResult.View, controller.ViewData, controller.TempData, sw);
                    viewResult.View.Render(viewContext, sw);

                    return sw.GetStringBuilder().ToString();
                }
            }
            catch (Exception ex)
            {
                return ex.ToString();
            }
        }

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.