lommeregner i asp
Har 2 dokumenter, den ene en html fil med følgende kode:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Simpel lommeregner i CSS</title>
<style type="text/css">
<!--
.style1 {color: #000066}
-->
</style>
</head>
<body>
<form id="calc" name="calc" method="get" action="calc.asp">
<table width="472" border="0">
<tr>
<th width="229" scope="col">Første Tal </th>
<th width="233" scope="col"><label> </label>
<div align="left">
<input name="varA" type="text" id="varA" />
</div></th>
</tr>
<tr>
<th scope="row">Andet Tal </th>
<td><label> </label>
<div align="left">
<input name="varB" type="text" id="varB" />
</div></td>
</tr>
<tr>
<th scope="row">Addition</th>
<td><label>
<input name="operator" type="radio" value="Add" />
</label></td>
</tr>
<tr>
<th scope="row">Substraktion</th>
<td><input name="operator" type="radio" value="Substract" /></td>
</tr>
<tr>
<th scope="row">Multiplikation</th>
<td><input name="operator" type="radio" value="Multiply" /></td>
</tr>
<tr>
<th scope="row">Division</th>
<td><input name="operator" type="radio" value="Divide" /></td>
</tr>
<tr>
<th height="206" scope="row"><img src="calculator.GIF" width="157" height="160" /></th>
<td><label>Calculate
<input type="submit" name="Submit" value="Submit" />
</label></td>
</tr>
</table>
<div align="center" id="main"><a href="index.htm" class="style1">Tilbage til Hovedsiden </a></div>
</form>
<label></label>
<p> </p>
</body>
</html>
Den anden et asp dokument med følgende kode:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Svaret</title>
</head>
<%
theVarA = CInt(Request.Querystring("varA") )
theVarB = CInt(Request.Querystring("varB"))
theOperator = Request.Querystring("operator")
%>
<%
if theOperator = "Add" then theAnswer = theVarA + theVarB
if theOperator = "Subtract" then theAnswer = theVarA - theVarB
if theOperator = "Multiply" then theAnswer = theVarA * theVarB
if theOperator = "Divide" then theAnswer = theVarA / theVarB
%>
<body>
Svaret på udregningen er <% Response.write(theAnswer) %>
</body>
</html>
Jeg kan ikke få theAnswer til at blive vist? Hvordan gør jeg det?