I am trying to create a dialog using jQuery UI dialog. The dialog appears and works fine when the page launches (I left autoopen=true for this test).
$(function Test() {
$("#mydialog").dialog({
modal: true,
buttons: {
Ok: function () {
$(this).dialog("close");
}
}
});
});
However when I try to open the dialog in code behind, instead of a popup, I get the text appears embedded in the page, "flat", without borders, buttons, etc. It looks like it is losing the style at postback? This is the code I am using in the code behind
Page.ClientScript.RegisterStartupScript(Me.GetType(), "Call my function", "Test();", True)
I also tried to use the runjQueryCode posted around on the web - runjQueryCode("Test();")
What am I doing wrong?
Thanks in advance!