This code displays a Jquery dialog with an html textbox that is shown after the user clicks on an asp:button btnNewGroup
<script type="text/javascript" language="javascript">
function pageLoad(sender, args) {
var $dialog = $('<div><fieldset><label for="name">Name</label><input type="text" name="Name" id="name" class="text ui-widget-content ui-corner-all" /></div>')
.dialog({
modal: true,
autoOpen: false,
title: 'Enter New Group Name',
buttons: {
'New': function () {
$(this).dialog('close');
},
Cancel: function () {
$(this).dialog('close');
}
}
});
$("#<%=btnNewGroup.ClientID %>").click(function () {
$dialog.dialog('open');
return true;
});
}
</script>
<asp:Button ID="btnNewGroup" runat="server" Height="26px"
onclick="btnNewGroup_Click" Style="margin-bottom: 0px" Text="New Group"
ClientIDMode="Static" />
protected void btnNewGroup_Click(object sender, EventArgs e)
{
String t = Request.Form["Name"];
}
When the user clicks the new button in the dialogue I want to take the name from the textbox and use it in my code behinds asp new button click event.