ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Do not close awesome popup in success function
Title:
B
I
{code}
?
Hello I do not want to close awesome popup in define function of success. is it possible ? if yes, can you say how to do it? ex. @(Html.Awe().InitPopupForm().Name("pf1").Url(Url.Action("ZipCode", "ZipCode")).Title("ZipCode Detail").Success("CreatedRecord").Height(500)) <script type="text/javascript"> function CreatedRecord(result, popup) { if (result[0] == true) { alert(result[1]); RebindZipCode(); } else if (result[0] == false) { alert(result[1]); return false; } } </script> I do not want to close popup in else part of above function.
Save Changes
Cancel
asked at 26 Dec 2014
Answers
B
I
{code}
?
the popupform won't close the popup if you return a string (view/content) instead of json when for example you have server side validation error you would return View(viewModel) and the form content will be replaced you can also see this being used in the wizard demo (http://demo.aspnetawesome.com/WizardDemo) where on each step the content of the popup is replaced so instead of return Json(...) do return View(viewModel), if you need some js to run just that time you can set viewModel.RunFooScript = true and in the view you can use this bool to render js, e.g. <% if(Model.RunFooScript){ %> <script> ...
Save Changes
Cancel
Omu
answered at 26 Dec 2014
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK