Asp.net mvc 4 为什么dialog只是第一次打开我的对话框?
我有一个div(mvc4剃须刀): 我清理我的浏览器缓存并检查脚本文件,如果它不支持dialog why首次工作 我的功能代码:Asp.net mvc 4 为什么dialog只是第一次打开我的对话框?,asp.net-mvc-4,razor,modal-dialog,Asp.net Mvc 4,Razor,Modal Dialog,我有一个div(mvc4剃须刀): 我清理我的浏览器缓存并检查脚本文件,如果它不支持dialog why首次工作 我的功能代码: $.ajax({ url: "OpenSendDialog", type: "GET", }) .done(function (result) { $("#clientdetailmodal").html(result).dialog({ autoOpen: true, modal: true, show: {
$.ajax({
url: "OpenSendDialog",
type: "GET",
})
.done(function (result) {
$("#clientdetailmodal").html(result).dialog({
autoOpen: true, modal: true, show: {
effect: "blind",
duration: 500
}
});
});
}
在我看来:
<div id="clientdetailmodal"></div>
我认为你的职能和她的范围有问题 听着,我希望这能帮助你:
var dialogtrigger=null; // global scope
$(function() {
dialogtrigger = function (){
//replace with your ajax call
$("#clientdetailmodal").html($('#content')).dialog({
autoOpen: false, modal: true, show: {
effect: "blind",
duration: 500
}
});
}
$( "#opener" ).click(function() {
// or destruct your modal on close and re-call your ajax
$( "#clientdetailmodal" ).dialog( "open" );
});
})) 可能重复的
<div id="clientdetailmodal"></div>
[HttpGet]
public ActionResult OpenSendDialog()
{
return view();
}
var dialogtrigger=null; // global scope
$(function() {
dialogtrigger = function (){
//replace with your ajax call
$("#clientdetailmodal").html($('#content')).dialog({
autoOpen: false, modal: true, show: {
effect: "blind",
duration: 500
}
});
}
$( "#opener" ).click(function() {
// or destruct your modal on close and re-call your ajax
$( "#clientdetailmodal" ).dialog( "open" );
});