I want to use @ Ajax.ActionLink to pop up a form, so I did this on my cshtml page:
@Ajax.ActionLink("click ", "AddToMembers", new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "result", InsertionMode = InsertionMode.Replace, OnSuccess = "openPopup" }) <div id="result" style="display:none;"></div>
and add this script:
<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>
in my controller this function is added:
[HttpGet] public PartialViewResult AddToMembers() { return PartialView(); }
but when I click on "click", a new page opens in my browser in my form. not in my popup form what is the problem ???
source share