C# Fancybox没有';ajax调用成功后无法工作

C# Fancybox没有';ajax调用成功后无法工作,c#,fancybox,C#,Fancybox,为什么在c#中检查验证后不使用fancybox fancybox是在使用PageMethods.validacionAdmin(onSuccessValidacionAdmin)之后调用的如果有效,则返回在中执行的数据库: [WebMethod] public static DeleteAccountResult ValidacionIsAdmin() { DeleteAccountResult res = new DeleteAccountResult(); ... // Que

为什么在c#中检查验证后不使用fancybox

fancybox是在
使用PageMethods.validacionAdmin(onSuccessValidacionAdmin)之后调用的如果有效,则返回在中执行的数据库:

[WebMethod]
public static DeleteAccountResult ValidacionIsAdmin()
{
   DeleteAccountResult res = new DeleteAccountResult();

   ... // Query to database with ok results

   res.ok = true;

   return res;
}
验证它的ajax客户端调用是:

jQuery(".delete a").click(function () {

            function onSuccessValidacionIsAdmin(data) {
                if (data.ok == true) {
                    jQuery("#<%= divError.ClientID %>").hide();

                    jQuery(".delete a").fancybox({
                        content: jQuery('#eliminar-cuenta').html(),
                        modal: false,
                        showCloseButton: false,
                        onComplete: function () {
                            jQuery("input[type=checkbox]").uniform()

                            jQuery('#privacidad').fancybox({
                                enableEscapeButton: false,
                                hideOnOverlayClick: false,
                                showCloseButton: true,
                                onComplete: function () {
                                    jQuery('#fancybox-close').off().on('click', function (e) {
                                        e.preventDefault();
                                        jQuery(".delete a").click();
                                    });
                                }
                            });
                        }
                    });
                }
                else {
                    jQuery("#<%= divError.ClientID %>").show();
                    jQuery("#lblError")[0].innerHTML = data.strError;
                }
            }

            PageMethods.ValidacionIsAdmin(onSuccessValidacionIsAdmin);
        });
jQuery(“.delete a”)。单击(函数(){
函数onSuccessValidActionAdmin(数据){
如果(data.ok==true){
jQuery(“#”).hide();
jQuery(“.delete a”).fancybox({
内容:jQuery('#eliminar cuenta').html(),
莫代尔:错,
showCloseButton:false,
onComplete:函数(){
jQuery(“输入[类型=复选框]”).uniform()
jQuery('#privacidad').fancybox({
enableEscapeButton:false,
HideonOverlyclick:错,
showCloseButton:正确,
onComplete:函数(){
jQuery(“#fancybox close”).off().on('click',函数(e){
e、 预防默认值();
jQuery(“.delete a”)。单击();
});
}
});
}
});
}
否则{
jQuery(“#”)show();
jQuery(“#lblError”)[0].innerHTML=data.strError;
}
}
PageMethods.ValidacionIsAdmin(onSuccessValidacionIsAdmin);
});
这种行为就像是在推送打开fancybox的链接后不打开它,就像它“刷新”了web,我推送了相同的链接,然后它就开始工作了

在ajax调用(在我的例子中是c#验证)之后,我读到fancy不起作用


我的问题是:为什么会这样?

经过几个小时的调查,我找到了解决办法。奇怪的是,在所有的吉祥物中,写下的内容是:。。。我替换为:“内容”:

我添加了属性“type”:“html”

之后,fancybox开始工作

 jQuery(".delete a").fancybox({
    'content': jQuery('#eliminar-cuenta').html(),
     'type': 'html',
    'modal': false,
    'showCloseButton': false,
    'onComplete': function () {
        jQuery("input[type=checkbox]").uniform()

        jQuery('#privacidad').fancybox({
            enableEscapeButton: false,
            hideOnOverlayClick: false,
            showCloseButton: true,
            onComplete: function () {
                jQuery('#fancybox-close').off().on('click', function (e) {
                    e.preventDefault();
                    jQuery(".delete a").click();
                });
            }
        });
    }
});

是的,我应该在fiddle中看到什么?你们可以在那个里制作演示并在这里放置链接,这样其他用户就可以使用它了。我如何模拟ajax请求?在jsfiddle中,我想是更多的
类型:'html'
选项完成了trickIt,这很奇怪,但当我做了更改时,一切都在工作,除了在角落按下关闭按钮时,对话框再次出现,这是一个循环。当showCloseButton设置为false时,我避免用户单击该按钮,并在对话框末尾写入一个正常按钮以关闭。但现在它正在发挥作用