ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
PopUpForm with Success Handler
Title:
B
I
{code}
?
Hi O! I'm using PopupForm with "Success" handler calling Java function. In Examples I found following syntax: function created(result, popup) { alert('dinner created'); } I assume result contains my JSON Object but what does "popup" parameter mean? And how correctly pass returned JSON object to Controller action.
Save Changes
Cancel
TT Tom
asked at 12 Nov 2015
omg, it's so simple $.post("@Url.Action("Action","Controller")", result); but my problem still exists. If I use RefreshOnSuccess the whole page reloads (Header & Footer incl.), I want only to refresh my result list like after submit of search criteria. I think it should be a "get" request.
at 12 Nov 2015
TT Tom
popup parameter is $(popupdiv); you haven't specified what you want to refresh, but assuming it's a grid you can call $('#Grid1').data('api').load()
at 12 Nov 2015
Omu
Thanks for your answer. I don't use grid control (not yet :)). It's just a asp.mvc view using my modelview. The whole page uses my _Layout.cshtml. If I use RefreshOnSuccess the whole page reloads, so for the short time there is only a white page, then my header and footer and the result list (between) are loaded. What I'm trying to achieve is to reload only the result list (a view content) without refreshing header and footer
at 12 Nov 2015
TT Tom
return PartialView in GetContent action <div id='mycontent'> res </div> $.post("@Url.Action("GetContent","Controller")", params1, function(res){ $('#mycontent').html(res); });
at 12 Nov 2015
Omu
OK, nice, but fits not quite in my architecture. But inspired me to give a try @using (Html.BeginForm("Index", "Controller", FormMethod.Get, new { id = "myForm" })) ... @(Html.Awe().InitPopupForm().Name("SetFilter").Success("reloadPage") ... function reloadPage(result, popup) {$("#myForm").submit();} works perfectly. Thanks a lot for inspiring & supporting me :)
at 12 Nov 2015
TT Tom
Answers
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