@ Ajax.ActionLinkを使用してフォームをポップアップしたいので、cshtmlページでこれを行いました:
@Ajax.ActionLink("click ", "AddToMembers", new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "result", InsertionMode = InsertionMode.Replace, OnSuccess = "openPopup" })
<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>
私のコントローラーにこの関数を追加しました:
[HttpGet]
public PartialViewResult AddToMembers()
{
return PartialView();
}
しかし、フォームの「クリック」をクリックすると、新しいページがブラウザで開きます。私のポップアップフォームではない問題は何ですか?