Someone help with this please, .modal dialog in a page loaded through .load

Someone help with this please, .modal dialog in a page loaded through .load

    This is my main page:

    1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="newpage.aspx.cs" Inherits="newpage" %>

    2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    3. <html xmlns="http://www.w3.org/1999/xhtml">
    4. <head runat="server">
    5.     <title></title>
    6.     <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    7.         <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
    8. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    9. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>

    10. <script type="text/javascript">

    11.     $(document).ready(function () {
    12.         $("#nrd").click(function () {
    13.             $('#result').load("test.aspx");
    14.         });
    15.         $("#nrd2").click(function () {
    16.             $('#result').load("saveoup.aspx");
    17.         });
    18.     });

    19. </script>

    20. </head>
    21. <body>
    22.     <form id="form1" runat="server">
    23. <div id="header">
    24.             <div id="butts">
    25.                 <input type="button" id="nrd" value="New Record"/>
    26.         <input type="button" id="nrd2" value="Save"/>
    27.             </div>
    28.             
    29.         <div id="usrlogged"><asp:Label ID="lblusr" runat="server" Text="USER:"></asp:Label></div>
    30.             
    31.             </div>
    32.     <div id="content">

    33.   
    34.        <div id="result"> </div>
    35.     </div>
    36.           <div id="footer">
    37. <p>Copyright &copy;</p>
    38.         </div>
    39.     </form>
    40. </body>
    41. </html>

    And this is the page which is loaded into the main page.

    1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="saveoup.aspx.cs" Inherits="saveoup" %>

    2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    3. <html xmlns="http://www.w3.org/1999/xhtml">
    4. <head id="Head1" runat="server">
    5.     <title></title>
    6.    <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
    7.     <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
    8.     <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>

    9.  
    10.     <style type="text/css">
    11.     
    12.     .ui-widget {
    13.     font-size:70%;
    14. }
    15.     </style>

    16.     <script>
    17.         $(function () {
    18.             $("#dialog-modal").dialog({
    19.                 autoOpen: false,
    20.                 height: 140,
    21.                 modal: true
    22.             });

    23.             $("#abutt")
    24.       .button()
    25.       .click(function () {
    26.           $("#dialog-modal").dialog("open");
    27.       });
    28.         });

    29.   </script>

    30. </head>
    31. <body>
    32.     <form id="form1" runat="server">
    33.     <p>Last unsaved data:</p><br /><br />

    34.                     <asp:GridView ID="GridView1" runat="server"
    35.                     Width="900px" CellPadding="4" 
    36.                     ForeColor="#333333" GridLines="None">
    37.                     <AlternatingRowStyle BackColor="White" />
    38.                     <Columns>
    39.                         <asp:TemplateField>
    40.                             <ItemTemplate>
    41.                                 <input type="button" id="upbutt" value="edit" />
    42.                             </ItemTemplate>
    43.                 
    44.                         </asp:TemplateField>
    45.                     </Columns>
    46.                     <EditRowStyle BackColor="#7C6F57" />
    47.                     <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
    48.                     <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
    49.                     <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
    50.                     <RowStyle BackColor="#E3EAEB" />
    51.                     <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
    52.                     <SortedAscendingCellStyle BackColor="#F8FAFA" />
    53.                     <SortedAscendingHeaderStyle BackColor="#246B61" />
    54.                     <SortedDescendingCellStyle BackColor="#D4DFE1" />
    55.                     <SortedDescendingHeaderStyle BackColor="#15524A" />
    56.                 </asp:GridView>
    57.  


    58.                 <div id="dialog-modal" title="Modify selected row." >
    59.                 <table>
    60.                 <tr>
    61.                 <td><asp:Label ID="Label1" runat="server" Text="ID:"></asp:Label> </td>
    62.                 <td><asp:TextBox ID="txtbadd1" runat="server" ReadOnly="true"></asp:TextBox></td>
    63.                 </tr>
    64.                 <tr>
    65.                     
    66.                 <td><asp:Label ID="Label2" runat="server" Text="Name:"></asp:Label> </td>
    67.                 <td><asp:TextBox ID="txtbadd2" runat="server"></asp:TextBox></td>
    68.                 </tr>
    69.                 <tr>
    70.                 <td><asp:Label ID="Label3" runat="server" Text="Code:"></asp:Label> </td>
    71.                 <td><asp:TextBox ID="txtbadd3" runat="server"></asp:TextBox></td>
    72.                 </tr>
    73.                 <tr>
    74.                 <td><asp:Label ID="Label4" runat="server" Text="Address:"></asp:Label> </td>
    75.                 <td><asp:TextBox ID="txtbadd4" runat="server"></asp:TextBox></td>
    76.                 </tr>
    77.                 <tr>
    78.                 <td><asp:Label ID="Label5" runat="server" Text="Phone:"></asp:Label> </td>
    79.                 <td><asp:TextBox ID="txtbadd5" runat="server"></asp:TextBox></td>
    80.                 </tr>
    81.                 <tr>
    82.                 <td><asp:Label ID="Label6" runat="server" Text="nthg:"></asp:Label> </td>
    83.                 <td><asp:TextBox ID="txtbadd6" runat="server"></asp:TextBox></td>
    84.                 </tr>
    85.                 </table>
    86.                 
    87.                 </div>

    88.                 <input type="button" value="test" id="abutt" />
    89.     </form>


    90.    
    91. </body>
    92. </html>
    It doesn't work on Chrome browser and it works on IE but it's messed up.

    What is wrong in my code?

    I found the following error:

    1. Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open' jquery-1.8.3.js:477
      1. jQuery.extend.error jquery-1.8.3.js:477
      2. (anonymous function) jquery-ui.js:521
      3. jQuery.extend.each jquery-1.8.3.js:611
      4. jQuery.fn.jQuery.each jquery-1.8.3.js:241
      5. $.fn.(anonymous function) jquery-ui.js:517
      6. (anonymous function) newpage.aspx:14
      7. c.event.handle jquery.min.js:55
      8. j.handle.o