Fancybox - ASP.NET button not working

前端 未结 14 1013
一生所求
一生所求 2020-12-01 02:13

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.

14条回答
  •  旧巷少年郎
    2020-12-01 02:43

    For anyone needing a simple answer to this problem using Fancybox version 2 theres a much easier way of doing it. All you have to do is add parent: "form:first" in the code eg

        $(document).ready(function () {
            $(".various").fancybox({
                parent: "form:first",
                fitToView: true,
                width: '300px',
                height: '100px',
                autoSize: false,
                closeClick: false,
                openEffect: 'none',
                closeEffect: 'none',
                modal: false
            });
        });
    

    then this will append the fancybox elements in the dom inside the form tag, rather than inside the body tag.

提交回复
热议问题