@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Add</title>
<script src="~/Content/jquery-3.1.1.js"></script>
</head>
<body>
<div>
<form id="form0">
<p>
会员卡号:<input type="text" name="VIPNum" />
</p>
<p>
类型:<select name="TId">
<option value="0">--请选择--</option>
@foreach (var item in Enum.GetValues(typeof(LC.Entity.EntityEnums.TypeEnums)))
{
<option value="@item.GetHashCode()">@item</option>
}
</select>
</p>
<p>
密码:<input type="text" name="Pwd" />
</p>
<p>
期限: @foreach (var item in Enum.GetValues(typeof(LC.Entity.EntityEnums.QiXianEnums)))
{
<input type="radio" value="@item.GetHashCode()" name="Qx" />@item
}
</p>
<p>
姓名:<input type="text" name="Name" />
</p>
<p>
性别:
@foreach (var item in Enum.GetValues(typeof(LC.Entity.EntityEnums.SexEnums)))
{
<input type="radio" value="@item.GetHashCode()" name="Sex" />@item
}
</p>
<p>
生日:<input type="date" name="CreateDate" />
</p>
<p>
<input type="button" value="提交" onclick="add()" />
</p>
</form>
</div>
</body>
</html>
<script>
function add() {
$.ajax({
url: "/Users/Add",
type: "post",
data: $("#form0").serialize(),
success: function (d) {
console.log(d);
if (d > 0) {
alert("成功");
location.href = '/Users/Index';
}
}
})
}
</script>