1

I'm calling an dialog from code behind and i've an asp:button. Now i'm trying to call the click event of asp:button inside the dialog but with no sucess.

First i've a jQuery function on document ready that doesn't allow the dialog to open, then i register this script through code behind. (if i don't add the function "open" the dialogs works properly but doesn't call the event. if i add like i have in the code bellow, the dialog just don't open but i don't get any javascript error).

sb.Append("$('#mensagemUtilizador').dialog({ ");
sb.Append("position:'center', width:'auto', autoresize:true, modal:true,");
sb.Append("open: function(type,data) {");
sb.Append("$(this).parent().appendTo(\"form\");");
sb.Append("}");
sb.Append("}");
sb.Append("});");
ScriptManager.RegisterStartupScript(this, GetType(), "openDialog", sb.ToString(), true);

Am i doing something wrong?

I've tried too to add an jQuery button. Then i tried to call a Webservice with that button click event but with no sucess too.

1 Answer 1

1

Try to surround your code with

$(document).ready(function () {
    //your code here
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.