使用Action()和ActionLink()生成链接

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
     <a href="@Url.Action("GetStuList", "Student", new {id=1001,age=20,gender=0 })">学生管理</a>
        <br /><br />
        @Html.ActionLink("详细信息", "GetStuList", "Student", new { id = 1001, age = 20, gender = 0 },
        new { @class="stulink",title="学生姓名"})
    </div>
</body>
</html>

提示:使用Html.RouteLink()代替Html.ActionLink()

提示:可以使用Html.Action()代替Url.Action

posted @ 2018-01-09 21:57  爱踢两键  阅读(204)  评论(0编辑  收藏  举报