2
我需要顯示一個消息框以確認是否刪除一個Item,但不知道如何使用javascript alert,我得到確認?如何顯示消息框並獲得確認YES或NO aspx.cs
我需要顯示一個消息框以確認是否刪除一個Item,但不知道如何使用javascript alert,我得到確認?如何顯示消息框並獲得確認YES或NO aspx.cs
您可以使用confirm
功能:
if (confirm('Are you sure you want to delete this item?')) {
// TODO : the user confirmed
}
正如您所標記你的問題與ASP.NET:
<asp:LinkButton
ID="DeleteButton"
runat="server"
CommandName="Delete"
Text="Delete"
OnClientClick="return confirm('Are you sure you want to delete this item?');"
/>
嘿感謝的人:) – BreakHead 2010-08-15 08:24:33