Click here to Skip to main content
15,881,413 members
Articles / Web Development / ASP.NET
Tip/Trick

Postback Events Not Working in jquery Pop Up ASP.NET

Rate me:
Please Sign up or sign in to vote.
5.00/5 (5 votes)
22 Nov 2015CPOL 15K   7   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:

JavaScript
   $(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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India
Software developer in Microsoft technologies ASP.NET, C# ,MVC,KNOCKOUT JS, TELRICK CONTROL, JQUERY, BOOTSTRAP, ORACLE ,SQL SERVER,ENTITY FRAMEWORK,php, oracle

Comments and Discussions

 
Praisethanks Pin
Member 121860501-Feb-16 20:06
Member 121860501-Feb-16 20:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.