如何使用jquery mobile刷新我的对话框而不刷新我的页面?当我尝试单击“不是现在”而不刷新页面后从输入框中插入数据时。没关系..萤火虫没有显示任何信息。
但是当我再次刷新并尝试插入数据并单击保存按钮时,验证无效......萤火虫将发出消息POST http://localhost:12230/
现在当我尝试再次按下取消按钮并出现对话框时...当我关闭对话框时...它将刷新页面...根据firebug打开取消按钮并单击“不现在“它会显示GET http://localhost:12230/
<div data-role="page" data-theme="a">
<div data-role="header" data-theme="a">
<a href="#CancelDialogPage" data-icon="arrow-l" data-rel="dialog" data-theme="b" id="opencanceldialog">Cancel</a>
<h1>@ViewBag.Title</h1>
</div>
<h2>New Account</h2>
<div data-role="content" data-theme="a">
@using (Html.BeginForm())
{
@Html.ValidationSummary(true, "Registration Failed! Check your Registration Details.")
<div>
<fieldset>
<div>@Html.LabelFor(u => u.NewAcctName)</div>
<div>
@Html.TextBoxFor(u => u.NewAcctName)
@Html.ValidationMessageFor(u => u.NewAcctName)
</div>
<div>@Html.LabelFor(u => u.NewDispName)</div>
<div>
@Html.TextBoxFor(u => u.NewDispName)
@Html.ValidationMessageFor(u => u.NewDispName)
</div>
<div>@Html.LabelFor(u => u.NewEmail)</div>
<div>
@Html.TextBoxFor(u => u.NewEmail)
@Html.ValidationMessageFor(u => u.NewEmail)
</div>
<div>@Html.LabelFor(u => u.NewPassword)</div>
<div>
@Html.PasswordFor(u => u.NewPassword)
@Html.ValidationMessageFor(u => u.NewPassword)
</div>
<input type="submit" value="Save New Account" data-theme="b" id="btnNewAcct" />
</fieldset>
</div>
}
</div>
<div data-role="footer" data-theme="a">
<h1>Copyright © 2013</h1>
</div>
<div data-role="content" id="CancelDialogPage" data-theme="e">
<div data-role="header" data-theme="a">
<h2>OSOA Warning!</h2>
</div>
<div data-role="content">
<h3><p>Are you sure you want to Cancel this New Account?</p></h3>
<input type="button" value="Sounds good to me" data-theme="b" id="yescanceldialog" />
<input type="button" value="Not now" data-theme="d" id="nocanceldialog" />
</div>
@section Scripts{
<script>
$(document).ready(function () {
//THIS IS FOR CLOSING THE CANCEL ACCOUNT DIALOG
$("#nocanceldialog").click(function (e) {
$("#CancelDialogPage").dialog("close");
$.mobile.page.prototype.options.domCache = true;
});
});