0
我想創建一個確認框,當用戶想要刪除他的帳戶,因爲他需要插入他的密碼(在文本框中)。但我不知道如何捕捉到回發事件和背後的代碼執行方法...
這是我的代碼:用文本框確認對話框回發
我的對話框:
<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');
}
}
})
});
能
人幫我?謝謝。
我不能?如果我把這個<%= this.Page.ClientScript.GetPostBackEventReference(new PostBackOptions(this.lb_remove))%>;會做出回發,但我不知道如何捕捉此事件:S – oteal
@ user1546424顯示您遇到問題的位置? – freebird
當用戶點擊刪除時,我需要做什麼? – oteal