@model TP.DistribSys.Shop.WebUI.Models.RegisterViewModel
@{
ViewBag.Title = "注册";
}
<html>
<head>
<title>@ViewBag.Title</title>
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script type="text/javascript">
</script>
</head>
<body>
<h3>经销商注册</h3>
<iframe id="loginiframe" frameborder="0" scrolling="no" style="left:0px; top:0px;" width="500" height="600" marginheight="0" marginwidth="0" src="@ViewBag.reqUrl"></iframe>
</body>
</html>
@model TP.DistribSys.Server.APIs.Models.RegisterViewModel
@{
ViewBag.Title = "注册";
Layout = null;
}
<h2>@ViewBag.Title.</h2>
@using (Html.BeginForm("Register", "Account", new { ReturnUrl = ViewBag.ReturnUrl, ClientId = ViewBag.ClientId }, FormMethod.Post, new { @class = "form-horizontal", role = "form", id = "registerform" }))
{
@Html.AntiForgeryToken()
<h4>用户注册</h4>
<hr />
@Html.ValidationSummary("", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.PasswordFor(m => m.Password, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.Phone, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.TextBoxFor(m => m.Phone, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.Address, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.TextBoxFor(m => m.Address, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.Connact, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.TextBoxFor(m => m.Connact, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.CompanyName, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.TextBoxFor(m => m.CompanyName, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="button" class="btn btn-default" id="btnRegister" onclick="test()" value="Register" />
</div>
</div>
<script type="text/javascript">
function test() {
var o = $("#registerform").serializeArray();
var clientId = "@ViewBag.ClientId";
var returnUrl = "@ViewBag.ReturnUrl";
alert(returnUrl);
$.ajax({
url: $("#registerform")[0].action,
type: $("#registerform")[0].method,
data: { data: JSON.stringify(o), clientId: clientId, returnUrl: returnUrl },
success: function (result) {
alert("ddddd");
//changeUrl("?ctl=Mark/GoodPointRule&act=Index");
},
error: function (result) {
}
});
}
</script>
}
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
这是两个域名下的页面是跨域名调用的但是是test()的方法一直无法执行求解决方法
这代码一贴,我凌乱了。
我去,这也行~
方法写错了