From what I can see, there seems to be some sort of a conflict between the JQuery 'load' and the 'dialog' functions. Do you really need to be adding the dialog to the element every time this function is called?
The following works in my browser.
Javascript:
var dlg;
$(document).ready(function () {
dlg = $("[id$='Main_ProductEdit']");
dlg.dialog({ autoOpen: false, modal: true, show: 'slide', close: 'slide', width: 400, height: 160,
buttons: { "cancel": function () { dlg.dialog("close"); } }
});
});
function LoadGridView() {
dlg.load('ProductEdit.aspx');
dlg.dialog("open");
}
HTML:
<input type="button" value="Open" onclick="LoadGridView();"/>