的fancybox - ASP.NET按钮不工作

问题描述:

我刚刚决定使用Firebug所创建的fancybox窗口时,它实际上需要我所有的ASP.NET控件(包含在DIV标签),并把它们外在形式的标签。所以我想,这就是为什么那么ASP.NET按钮不会做任何事情的原因 - 它被放在外在形式

I've just determined using Firebug that when Fancybox window is created it actually takes all of my ASP.NET controls (contained in DIV tag) and puts them outside FORM tag. So I guess this is the reason why then ASP.NET button doesn't do anything - it is placed outside form.

那么,你有什么建议我怎么能prevent这个(或使该ASP.NET按钮的工作),除了使用完全不同的模态对话框?

So, do you have any suggestions how I can prevent this (or make that ASP.NET button work), other than using completely different modal dialog?

编辑:确定,人们都报告说,一些拟议的修正是在某些版本为他们工作。所以,一定要阅读所有的答案/滚动到底如何解决不同的fancybox版本这个问题。

OK, people are reporting that some of the proposed fixes are working for them on certain versions. So, be sure to read all of the answers / scroll to the bottom for how to fix this issue on different Fancybox versions.

您需要更改此(约jquery.fancybox-1.3.1.js的719线某处):

You need to change this (somewhere around line 719 of jquery.fancybox-1.3.1.js):

$('body').append(
    tmp         = $('<div id="fancybox-tmp"></div>'),
    loading     = $('<div id="fancybox-loading"><div></div></div>'),
    overlay     = $('<div id="fancybox-overlay"></div>'),
    wrap        = $('<div id="fancybox-wrap"></div>')
        );

$('form').append(
    tmp         = $('<div id="fancybox-tmp"></div>'),
    loading     = $('<div id="fancybox-loading"><div></div></div>'),
    overlay     = $('<div id="fancybox-overlay"></div>'),
    wrap        = $('<div id="fancybox-wrap"></div>')
);