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