1. 程式人生 > >MVC 後臺向前臺傳值,同一Controller下Action之間的傳值,Controller與Controller之間的傳值

MVC 後臺向前臺傳值,同一Controller下Action之間的傳值,Controller與Controller之間的傳值

login href text htm 密碼 log pos 前臺 html

@{
Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>登錄</h2>

<p>
@using(Html.BeginForm("Login", "Login", FormMethod.Post)){
<p>
<br>用戶:@Html.TextBox("username")
密碼:@Html.TextBox("password")
<input id="Submit1" type="submit" value="登錄" />
<a href="" class="btn btn-primary btn-lg">@TempData["Name"] &raquo;</a>
</p>
}
@Html.ActionLink("Action -> Action","Again",new { str = @TempData["Name"] })
@Html.ActionLink("Controller -> Controller", "Index","Home", new { str = @TempData["Name"] },null)
</p>
<p>
</p>

MVC 後臺向前臺傳值,同一Controller下Action之間的傳值,Controller與Controller之間的傳值