ASP.Net/Development/Client Event
Версия от 15:30, 26 мая 2010; (обсуждение)
asp button on client click (C#)
<%@ Page Language="C#" %>
<script runat="server">
protected void btnDelete_Click(object sender, EventArgs e)
{
lblResult.Text = "All pages deleted!";
}
</script>
<html>
<head>
<title>Button OnClientClick</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button
id="btnDelete"
Text="Delete Website"
OnClick="btnDelete_Click"
OnClientClick="return confirm("Are you sure?");"
Runat="server" />
<asp:Label
id="lblResult"
Runat="server" />
</div>
</form>
</body>
</html>