JqueryUI dialog box causes button to lose styling

Posted by superexsl on Stack Overflow See other posts from Stack Overflow or by superexsl
Published on 2010-04-14T03:31:46Z Indexed on 2010/04/14 3:32 UTC
Read the original article Hit count: 284

Hey everyone, I'm using JQueryUI dialog boxes and, while it works, it seems to remove any CSS styling on the button that opens the dialog. I have to manually refresh the page to get the styling back. An example button which launches the dialog: (button_submit is my CSS theme and launc_popup is used to detect the button click in JQuery.

<asp:Button ID="btnLaunch" CssClass="button_sub launch_popup" runat="server" Text="Dialog..." CausesValidation="false" OnClientClick="return false;" />

My jquery:

 $('.launch_popup').click(function() {
                $("#dialog-form").dialog("open");


            });

My dialog-form:

 $("#dialog-form").dialog({
                autoOpen: false,
                height: 300,
                width: 300,
                modal: true,
                buttons: {


                    'Close': function() {
                        $(this).dialog('close');
                    }
                }                  

            });

This happens to all the buttons that open dialogs. Is there a way to 'restyle' the button without refreshing the page? (It's in an updatepanel if that makes a difference, although this bit's client-side so not sure if that should affect it).

Thanks for any help

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about jQuery