Conditional statement with java script

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script language="javascript" type="text/javascript">
function myfunction() {
var i = 30;
if (i > 25) {
alert("Greater than 25.")
} else if (i < 0) {
alert("Less than 0.");
} else {
alert("not matching criteria.");
}


}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

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

</div>
</form>
</body>
</html>

Comments or Responses

Login to post response