Confirm dialog box with javascript

Posted by Jitendrasoft09 under ASP.NET category on | Points: 40 | Views : 904
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<script language="javascript" type="text/javascript">
function myfunction() {
if (confirm("Are you sure? ")) {
alert("You have cliked ok");
} else {
alert("you have cliked cancel ");

<html xmlns="">
<head runat="server">
<form id="form1" runat="server">

<asp:Button ID="Button1" runat="server" Text="Button"
OnClientClick="return myfunction()" onclick="Button1_Click1" />


Comments or Responses

Login to post response