I would like to render the razor code from the database to to a razor view. Would thatbe possible?
CONTROLLER/ACTION:
public ActionResult About()
{
ViewBag.Message = "Your application description page.";
ViewBag.RazorCode = "@Html.TextBox(\"txtTestRazor\")";
return View();
}
VIEW:
@{
ViewBag.Title = "About";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<p>Use this area to provide additional information.</p>
<h3>@ViewBag.RazorCode</h3>
HTML/OUTPUT:
About.
Your application description page.
Use this area to provide additional information.
@Html.TextBox("txtTestRazor")