I'm opening and closing dialogs that are dynamically created using ajax. I'd like to be able to have the buttons that appear on the dialogs use the jQuery UI button. I can do this by calling $("button").button(), but that affects every button element. How can I be specific to only affect the buttons that appear on this dialog?
var $dialog = $('<div>').load('/Dialog').dialog({
autoOpen: false,
title: 'Dialog',
height: 250,
width: 750,
resizable: false,
modal: true,
show: "fadeIn",
hide: "fadeOut"
});
$('#btnOpenDialog').click(function () {
$dialog.dialog('open');
return false;
});