public ActionResult Default()
{
ViewBag.Message = "Hello,World!";
var template = "<h1>@ViewBag.Message</h1>";
//How to make the content of the following "View" = "template"
return View();
}
次に、htmlの結果を次のようにビルドします。
<h1>Hello,World!</h1>
Plaseは私を助けてくれてありがとう!RazorEngineはRazorファイルを解析できますが、文字列を表示にレンダリングできません。