tags:

views:

34

answers:

0

I'm using ASP.NET and jQuery.

I have two dialog boxes, each of which have a button with a click event.

The form started with one, and everything worked fine. You could enter a fax number, click a button, and stuff would happen.

Adding in the second dialog box caused problems. The button in the first one just stopped working, but the second one does work. Can anyone see what I'm doing wrong here? I'm sure it has something to do with how I'm appending to the form, and that the TrackingWindow is overwriting the FaxesWindow. I'm just not certain how to get this to work correctly. The JavaScript is as follows:

        $FaxesWindow = jQuery("#faxesDialog");
        $TrackingWindow = jQuery("#trackingDialog");

        $FaxesWindow.dialog({ height: 285,
            width: 310,
            modal: true,
            bgiframe: true,
            position: ['center', 150],
            autoOpen: false,
            title: 'Enter fax number',
            overlay: { opacity: 0.5, background: 'black' }
        });
        $FaxesWindow.parent().appendTo(jQuery("form:first"));

        $TrackingWindow.dialog({ height: 290,
            width: 310,
            modal: true,
            bgiframe: true,
            position: ['center', 150],
            autoOpen: false,
            title: 'Enter Order Number',
            overlay: { opacity: 0.5, background: 'black' }
        });
        $TrackingWindow.parent().appendTo(jQuery("form:first"));

Portions of the two user controls are as follows: FaxesWindow:

<div style="padding-bottom:10px">
    <table>
        <tr>
            <td><asp:TextBox ID="txtFax" runat="server"></asp:TextBox></td>
            <td>
                <asp:ImageButton ID="ibGo" ImageUrl="~/images/btnOk.gif" runat="server" onclick="ibGo_Click" />
            </td>
        </tr>
    </table>    
</div>
<asp:UpdatePanel ID="upTed" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger controlid="ibGo" eventname="Click" />
    </Triggers>
    <ContentTemplate>
        <!-- snipped for brevity -->
    </ContentTemplate>
</asp:UpdatePanel> 

TrackingWindow:

<div style="padding-bottom:10px">
    <table>
        <tr>
            <td><asp:TextBox ID="txtTracking" runat="server"></asp:TextBox></td>
            <td>
                <asp:ImageButton ID="ibStart" ImageUrl="~/images/btnOk.gif" runat="server" OnClick="ibStart_Click" />
            </td>
        </tr>
    </table>    
    <br />
</div>
<br />
<asp:UpdatePanel ID="upTed2" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger controlid="ibStart" eventname="Click" />
    </Triggers>
    <ContentTemplate>
        <!-- Snipped for brevity-->
    </ContentTemplate>
</asp:UpdatePanel> 

Thanks!