|
<%@ Page language="c#" Codebehind="Calculator.aspx.cs" AutoEventWireup="false" Inherits="JSRS.Calculator" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>RS Calculator</title>
<script language="javascript" src="scripts/rs.js"></script>
<script language="JavaScript">
function MakeOperation()
{
RS.Execute("Calculator.aspx", "MakeOperation", document.Form1.operation.options[document.Form1.operation.selectedIndex].value, document.Form1.p1.value, document.Form1.p2.value, SetResult, errorCallback);
}
function SetResult(res)
{
result.innerHTML = res;
}
function errorCallback(result)
{
alert("Error: "+result);
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<INPUT id="p1" type="text" size="10">
<SELECT id="operation">
<OPTION selected value="add">+</OPTION>
<OPTION value="sub">-</OPTION>
<OPTION value="mul">*</OPTION>
<OPTION value="div">/</OPTION>
</SELECT>
<INPUT id="p2" type="text" size="10"> <INPUT id="b" type="button" value="eq" onclick="MakeOperation()">
<DIV id="result"></DIV>
</form>
</body>
</HTML>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.