Propblem in opening jQuery UI dialog in usercontrol

Propblem in opening jQuery UI dialog in usercontrol

When i tested UI modal dialog in aspx page its working fine, same code i have copied to usercontrols widget and it failed to display the dialog box, i am using kalitte dashboard inside widget i am calling a button click event to open modal dialog but it failed.
---
scripts included in default.aspx page where my dashboard exists
  1.     <link href="../../Styles/jqueryui18/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
        <script src="../../Scripts/jquery-1.5.1.js" type="text/javascript"></script>
        <script src="../../Scripts/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>

code which i wrote in my usercontrols [ .ascx ]
  1. <script type="text/javascript">
        $(document).ready(function () {
            $("input[id$='btnSample']").click(function () {
                $("#mydivTest").dialog({ modal: true });
            });
        });
    </script>
    <div id="mydivTest" title="Dialog Title" style="display: none">
        <table>
            <tr>
                <td>
                    product Name:
                </td>
                <td>
                    <asp:TextBox ID="txtProductName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Quantity:
                </td>
                <td>
                    <asp:TextBox ID="txtQuantity" runat="server"></asp:TextBox>
                </td>
            </tr>
        </table>
    </div>
    <ext:Button ID="btnPopup" runat="server" Text="Show Dialog">
        <Listeners>
            <Click Handler="$('#mydivTest').dialog({ modal: true });" />
        </Listeners>
    </ext:Button>
    <input type="button" id="btnSample" value="ClickMe" />


































i am getter javascript error
Microsoft JScript runtime error: Object doesn't support this property or method
@this code
  1.  $("#mydivTest").dialog({ modal: true });
can anyone tell me the solutions to show jquery ui modal dialog box when i click on button inside usercontrol which is a widget type