Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Postback Events Not Working in jquery Pop Up ASP.NET

0.00/5 (No votes)
22 Nov 2015 1  
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

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here