1

I have a JQuery UI Dialog which I have put an ASP.NET button on. I need to be able to call a server side OnClick event from this, but it is never called. Here is my Dialog, can somebody help?

<div id="dialogWrapper" runat="server">
    <div style="height: auto; width: auto;" id="dialog">
        <table> 
            <tr>
                <td width="300px" valign="top">
                    Current Documents :
                </td>
                <td width="300px" valign="top">
                    <table>
                        <tr>
                            <td>
                                Upload Document :
                            </td>
                        </tr>
                        <tr /><tr />
                        <tr>
                            <td>
                                <asp:FileUpload id="fileUploadControl" runat="server" Width="200px" />
                            </td>
                        </tr>
                        <tr /><tr />
                        <tr>
                            <td>
                                <asp:Button  ID="btnUploadFile" runat="server" OnClick="btnUploadFile_Click" Text="Upload File" />
                            </td>
                        </tr>
                    </table>

                </td>
            </tr>
        </table><br />
    </div>
</div>

EDIT : Here is how the dialog is being created :

$(document).ready(function() {

    $('#<%=dialogWrapper.ClientID %>').dialog({
        autoOpen: false,
        height: 250,
        width: 600,
        modal: true,
        title: "Upload/Open Files",
        show: "drop"
    });

});
1
  • Can you show how you create the dialog? Have a look here, there might be your answer. Commented May 12, 2011 at 15:23

1 Answer 1

4

jQueryUI puts the Dialog box outside of the ASP.NET Form tag and so your button won't register. Try appending the dialog to the Form tag like so:

    $('#divDialog').dialog({
     //your normal dialog settings...


      open: function(type,data) {
        $(this).parent().appendTo("form");
      }
    }); 

From this post.

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.