本博客是配合其他博客进行的举例,不用单独看。

@model WebApplication3.Models.IndexModel
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    @{ string s = "rupeng"; }<br/>
    [email protected]<br />
    @s<br />
    @s.Length;<br />

    @{ string qq = "sfsdsadfa"; }<br />
    <li>[email protected](qq.Length)</li><br />
    <span>[email protected](qq).com</span><br />
    <a href="abc(@s).ashx">aaa</a><br />
    <a href="[email protected](s).ashx">aaa</a><br />
    <div>
        <form action="/Test/Index" method="post">
            Num1:<input type="text" name="Num1" value="@Model.Num1" />+
            Num2:<input type="text" name="Num2" value="@Model.Num2" />
            <input type="submit" value="=" />
            <span>@Model.Result</span>

        </form>
    </div>
    @{ bool isOK = true;}
    <div style="color:@(isOK ? "red" : "green")">rupeng.com</div><br />
    <div style="color:@(isOK ? "green" : "red")">rupeng.com</div><br />

    @{ string s1 = "<a href = 'www.rupeng.com'>rupeng</a>";}<br />
    @s1<br />
    @Html.Raw(s1)<br />

    @*aaaaaaaaaaadddddddddddddd一般不在这里写*@

    <a href="~/1.jpg">aaa</a>
    <script>
        var a = "@Href("~/1.jpg")";
        </script>

    @{bool b1 = true ; }
    <span hello="@b1">88888888888</span><br />
    @this.GetType().Assembly.Location<br />
</body>
</html>

效果

MVC--Rzaor--例子

相关文章:

  • 2021-11-07
  • 2021-12-25
  • 2021-10-04
  • 2021-12-05
  • 2021-12-09
  • 2021-05-31
  • 2022-12-23
猜你喜欢
  • 2021-10-28
  • 2021-12-14
  • 2022-12-23
  • 2021-12-30
  • 2021-04-28
  • 2018-10-31
  • 2021-07-16
相关资源
相似解决方案