模态jQuery
<script type="text/javascript">
$(document).ready(function () {
$('#submit').click(function (e) {
var locked = '@ViewBag.Locked';
if (locked) {
e.preventDefault();
$('#accountLocked').reveal();
}
});
});
</script>
弹出分区
<div id="accountLocked" class="reveal-modal">
@using (Html.BeginForm("EmailHelpDesk", "Account", FormMethod.Post))
{
<h1>Account Locked</h1>
<p>Please provide your email address and you'll be contacted shortly.</p><br/>
<input type="email" id="email" name="email"/>
<input type="submit" id="submitEmail" name="submit"/>
}
</div>
AccountController 中的 EmailHelpDesk ActionResult
[HttpPost]
[AllowAnonymous]
public ActionResult EmailHelpDesk(string email)
{
var Email = email;
return RedirectToAction("Create", "User");
}
代码不会在 Action 上中断,我不明白为什么。难道我做错了什么?
模式弹出,但 EmailHelpDesk 方法不执行。提交时,模式消失了,什么也没有发生。