views:

299

answers:

1

Hi,

I want to add an asp:button to my dialog - for confirmation purposes as part of gathering some data. My intention is to postback on click.

I have no problems adding this button to the div that im turning into a dialog (or getting it to postback), however as expected, the button is not part of the dialog button pane - the lowest part of the dialog where buttons declared in options would show up as in:

$("#someDiv").dialog({
    buttons: {
        "Close": function() {
         $(this).dialog("close");
    }
}

How can i add my asp:button to this lowest button pane? Must i remove and append it to the dialog manually? Must i use __doPostback as part of the function call of my button declared as part of the dialog options?

Cheers!

A: 

You can not add custom buttons throe dialog control.

You can use event open: http://docs.jquery.com/UI/Dialog#event-open and append custom button, but than you must control dialog with method destroy or close.

I recommend you to use common JS function.

Append sample:

$('.ui-dialog div.ui-dialog-buttonpane').append('<button class="ui-state-default ui-corner-all" type="button">ASP</button>');
jmav