65.9K
CodeProject is changing. Read more.
Home

Postback Events Not Working in jquery Pop Up ASP.NET

starIconstarIconstarIconstarIconstarIcon

5.00/5 (5 votes)

Nov 20, 2015

CPOL
viewsIcon

15292

Postback event not working colorbox in ASP.NET

Introduction

Most jquery popup such as bpopup, colorbox, lightboxt, etc. render outside the form tag. So ASP.NET application these popup ASP.NET control is not working. So you have to write JavaScript program to move the content from body tag to form tag for example.

Using the JavaScript code:

       $(function () {
            var colorbox = $('.inline').colorbox({ open: true, inline: true, onOpen: ContentMovePostBack });
          
        });

        function ContentMovePostBack() {
            $("div#cboxOverlay").appendTo("form:first");
            $("div#colorbox").appendTo("form:first");
        }
        
    //bpopup
                    $('#my-button').bind('click', function (e) {
                    e.preventDefault();
                    $('#UserPopup').bPopup();
                   //
                    $('#UserPopup').appendTo("form:first");

                });    

History

  • 23rd November, 2015: Initial version