Created
August 19, 2010 19:04
-
-
Save house9/538621 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page | |
Language="C#" | |
AutoEventWireup="true" | |
CodeBehind="JavaScriptConfirm.aspx.cs" | |
Inherits="SandboxOne.JavaScriptConfirm" | |
%> | |
<!DOCTYPE...> | |
<html> | |
<head runat="server"> | |
<title>Javascript Confirm</title> | |
<script language="javascript" type="text/javascript"> | |
function AreYouSure() | |
{ | |
return confirm('are you sure you want to submit this form?'); | |
} | |
</script> | |
</head> | |
<body> | |
<form id="form1" runat="server"> | |
<input id="TestButton1" | |
type="button" | |
onclick="if(AreYouSure()) { document.forms[0].submit(); }" | |
value="A regular html 'button' button" | |
/> | |
<input id="TestButton2" | |
type="submit" | |
onclick="return AreYouSure();" | |
value="A regular html 'submit' button" | |
/> | |
<asp:Button ID="TestButton3" | |
OnClientClick="return AreYouSure();" | |
OnClick="InvokeServerSideMethod" | |
Text="A asp button" | |
runat="server" | |
/> | |
<asp:Button ID="TestButton4" | |
OnClick="InvokeServerSideMethod" | |
Text="A asp button c# wired OnClientClick" | |
runat="server" | |
/> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment