asp.net mvc - MVC-pop up windows -
i need create pop windows in mvc(not new tab in browser). know how this?
one possibility use jquery ui dialog.
edit
the idea have ajax action returns partial view. result of action (html) placed inside container of popup , on success handler of ajax call open popup. here sample code:
@ajax.actionlink("open popup", "someaction", new ajaxoptions { httpmethod = "get", updatetargetid = "result", insertionmode = insertionmode.replace, onsuccess="openpopup" })<br /> <div id="result" style="display:none;"></div> <script type="text/javascript"> $(document).ready(function() { $("#result").dialog({ autoopen: false, title: 'title', width: 500, height: 'auto', modal: true }); }); function openpopup() { $("#result").dialog("open"); } </script>
then have add action in controller returns partial view
[httpget] public partialviewresult someaction() { return partialview(); }
place whatever need in partial view, may include parameters in action, etc.
good luck!
Comments
Post a Comment