1  Razor模板引擎的使用:

    (1)常用三种模板引擎:

      Razor 解释执行,微软内置、有提示,与JavaScript存在兼容性;

      Nvelocity / Vtemplate 运行时动态执行,(比Razor更好)。

    (2)Razor引擎的使用:

      

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <h1>胡安定</h1>
    <div>
        <h2>@Model.Name</h2>
        <h2>@Model.Age</h2>
    </div>
    <div>
        <ul>
            @for (var i = 0; i < 10;i++ )
            {
                <li>@i</li>
            }
        </ul>
    </div>
</body>
</html>
razor1.cshtml

相关文章:

  • 2022-12-23
  • 2021-10-13
  • 2021-11-14
  • 2022-01-25
  • 2021-09-21
  • 2022-02-21
  • 2021-12-13
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
  • 2021-11-14
相关资源
相似解决方案