当用户想要删除他的帐户时,我想创建一个确认框,因为他需要插入他的密码(在文本框中)。但我不知道如何捕捉回发事件并在后面的代码中执行方法......
这是我的代码:
我的对话框:
<div id="dialog" title="Confirmation Required">
Are you sure about this?
Password:<asp:TextBox id="remove_password" TextMode="Password" runat="server"></asp:TextBox>
</div>
我调用对话框的按钮:
<asp:LinkButton ID="lb_remove" Text="Delete Account" runat="server" OnClientClick="javascript: $('#dialog').dialog('open'); return false;" ClientIDMode="Static" />
我的脚本:
$().ready(function() {
$("#dialog").dialog({
autoOpen: false,
modal: true,
bgiframe: true,
width: 400,
height: 300,
buttons: {
'Delete': function() {
//do something
//what to put here???
//i need to pass my textbox value or in
//codebehind i do findcontrol and will work?
//
},
'Cancel': function() {
$(this).dialog('close');
}
}
})
});
有人能帮我吗?谢谢。