Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Jquery Dialog box from Gridview.

Status
Not open for further replies.

primagic

IS-IT--Management
Jul 24, 2008
476
GB
I have a button within a template field in a gridview.

I am using the following code to try to open a dialog form but nothing is happening.

Code:
<script type="text/javascript">
           $(document).ready(function () {
               $("#dialog-create").dialog({ autoOpen: false, modal: false, width: '300px',  })
               $('#<%=gvCustomers.ClientID%> :button').click(function (e) {
                   $("#dialog-create").dialog('open');
                   return false;
               });

               $('#<%= btnSave.ClientID %>').click(function () {
                   __doPostBack('<%= btnSave.ClientID %>', '');
                $("#dialog-create").parent().appendTo(jQuery("form:first"));
                   $("#dialog-create").dialog('close');
                   return false;
               });
           });
</script>

Here is the dialog code:
Code:
<div id="dialog-create" title="Create New Subclient" class="dialog">
        
        <table class="table_dialogs">
        <tr>
            
        <td>Clientcode:</td>
        <td><asp:TextBox ID="txtSubClientCode" runat="server"></asp:TextBox></td>
        </tr>
          
        
        </table>
             <asp:Button runat="server" Text="Save" ID="btnSave" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"/>   
       </div>

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top