Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to open Dialog without refreshing the Page MVC4
    text
    copied!<p>how to fire my dialog box without refreshing my page using jquery mobile? when i try to click the <strong>"Not now"</strong> without inserting data from the inputbox after refreshing the page. it's ok.. the firebug doesnt show any message.</p> <p>but when i refresh again and try to insert data and click the save button then the validation is invalid... the firebug will give a message <code>POST http://localhost:12230/</code></p> <p>and now when i try to press the cancel button again and the dialog appear.. when i close the dialog.. it will refresh the page... according to firebug when opening the cancel button and click <strong>"not now"</strong> it will show <code>GET http://localhost:12230/</code></p> <pre><code>&lt;div data-role="page" data-theme="a"&gt; &lt;div data-role="header" data-theme="a"&gt; &lt;a href="#CancelDialogPage" data-icon="arrow-l" data-rel="dialog" data-theme="b" id="opencanceldialog"&gt;Cancel&lt;/a&gt; &lt;h1&gt;@ViewBag.Title&lt;/h1&gt; &lt;/div&gt; &lt;h2&gt;New Account&lt;/h2&gt; &lt;div data-role="content" data-theme="a"&gt; @using (Html.BeginForm()) { @Html.ValidationSummary(true, "Registration Failed! Check your Registration Details.") &lt;div&gt; &lt;fieldset&gt; &lt;div&gt;@Html.LabelFor(u =&gt; u.NewAcctName)&lt;/div&gt; &lt;div&gt; @Html.TextBoxFor(u =&gt; u.NewAcctName) @Html.ValidationMessageFor(u =&gt; u.NewAcctName) &lt;/div&gt; &lt;div&gt;@Html.LabelFor(u =&gt; u.NewDispName)&lt;/div&gt; &lt;div&gt; @Html.TextBoxFor(u =&gt; u.NewDispName) @Html.ValidationMessageFor(u =&gt; u.NewDispName) &lt;/div&gt; &lt;div&gt;@Html.LabelFor(u =&gt; u.NewEmail)&lt;/div&gt; &lt;div&gt; @Html.TextBoxFor(u =&gt; u.NewEmail) @Html.ValidationMessageFor(u =&gt; u.NewEmail) &lt;/div&gt; &lt;div&gt;@Html.LabelFor(u =&gt; u.NewPassword)&lt;/div&gt; &lt;div&gt; @Html.PasswordFor(u =&gt; u.NewPassword) @Html.ValidationMessageFor(u =&gt; u.NewPassword) &lt;/div&gt; &lt;input type="submit" value="Save New Account" data-theme="b" id="btnNewAcct" /&gt; &lt;/fieldset&gt; &lt;/div&gt; } &lt;/div&gt; &lt;div data-role="footer" data-theme="a"&gt; &lt;h1&gt;Copyright © 2013&lt;/h1&gt; &lt;/div&gt; </code></pre> <p></p> <pre><code>&lt;div data-role="content" id="CancelDialogPage" data-theme="e"&gt; &lt;div data-role="header" data-theme="a"&gt; &lt;h2&gt;OSOA Warning!&lt;/h2&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;h3&gt;&lt;p&gt;Are you sure you want to Cancel this New Account?&lt;/p&gt;&lt;/h3&gt; &lt;input type="button" value="Sounds good to me" data-theme="b" id="yescanceldialog" /&gt; &lt;input type="button" value="Not now" data-theme="d" id="nocanceldialog" /&gt; &lt;/div&gt; </code></pre> <p></p> <pre><code>@section Scripts{ &lt;script&gt; $(document).ready(function () { //THIS IS FOR CLOSING THE CANCEL ACCOUNT DIALOG $("#nocanceldialog").click(function (e) { $("#CancelDialogPage").dialog("close"); $.mobile.page.prototype.options.domCache = true; }); }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload