Views/Member/Login.cshtml
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
@model MvcShopping.Models.MemberLogin
@{
ViewBag.Title = "Login";
}
<h2>Login</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>MemberLogin</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control" } })
@*@Html.EditorFor(model => model.Email, new { data_val_email = "请输入正确的email", @class = "form-control" })//无效,编辑模板不行,必须使用textboxfor*@
@*@Html.TextBoxFor(model=>model.Email,new { data_val_email="请输入正确的email",@class = "form-control"}) @*有效*@
@*@Html.TextBoxFor(model=>model.Email,new { htmlAttributes = new { data_val_email = "请输入正确的email啊", @class= "form-control" } }) //无效*@
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Password, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="登陆" class="btn btn-default" />
</div>
</div>
</div>
}
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
@if (TempData["message"] != null)
{
<script>
alert('@HttpUtility.JavaScriptStringEncode(Convert.ToString(TempData["message"]))');
</script>
}
<script>
$(function () {
//debugger;
//$("#@Html.IdFor(model => model.Email)").rules("add", { messages: { email: "email不正确" } });
$.validator.messages={
required: "This field is required.",
后面还有 19 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。