修改视图

@model MODEL.biao

@{
Layout = null;
}

<!DOCTYPE html>

<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Create</title>
<script src="~/scripts/jquery-1.10.2.js"></script>
<script>
function tian(date) {
$("#form0").ajaxSubmit({
uri: "/Index/Create",
type: "post",
success: function (date) {
if (date > 0)
{
alert("修改成功");
location.href = "/Index/Index"
}
}
})
}
</script>
</head>
<body>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()

<div class="form-horizontal">
<h4>修改</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })

<div class="form-group">
姓名
<div class="col-md-10">
@Html.EditorFor(model => model.bname, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.bname, "", new { @class = "text-danger" })
</div>
</div>

<div class="form-group">
年龄
<div class="col-md-10">
@Html.EditorFor(model => model.age, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.bname, "", new { @class = "text-danger" })
</div>
</div>

<div class="form-group">
父母姓名
<div class="col-md-10">
@Html.DropDownList("lid", ViewBag.s as List<SelectListItem>, "--请选择--")
</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>
}
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/JXSBoKeYuan/p/9388502.html