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.
Here is the dialog code:
Any ideas?
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?