Question : ASP.NET Button postback not firing!!

Hi all,

I'm using colorbox (a lightweight jquery modal box plugin) to display several dialog boxes in my Asp.net AJAX enabled webpage (using updatepanel).

I have an asp button that's used for opening the dialog box as well as some server side scripting:

1:
<asp:Button ID="btnEditEntDoor" runat="server" Text="Edit Door" CssClass="adminButton entDoorsModalOpen" onclick="btnEditEntDoor_Click" Font-Size="9pt" />


And here's the javascript code that launches the colorbox:

   
1:
$(".entDoorsModalOpen").colorbox({ width: 600, height: 270, inline: true, href: "#entDoorsModal" });


The colorbox works great and launches when I click that button but the button no longer postsback so all my server-side code is never executed!

Anybody know how I can get the button to launch the modal box as well as postback?

PS - I'm not locked on using colorbox, I'm using it because I have tried the asp.net modalpopup extender but I will be needing a few on the same page and it just seems to buggy.  I have also tried thickbox and shadowbox as well and all of them seem to cancel out the buttons postback anyway!  
Thanks!!!

Answer : ASP.NET Button postback not firing!!

- Set: btnEditEntDoor onclick attribute to a function, for example showColorBox() and add return true.
Ex:
btnEditEntDoor.Attributes("onclick") = "showColorBox(); return true";

If you change it to "return false" then the btnEditEntDoor will never postback to server.

In the showColorBox function, just call the pop up dialog, and then it will return true and cause the btnEditEntDoor postback to server.
Random Solutions  
 
programming4us programming4us