关于asp网页编程的问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 17:40:38
<html>
<p>User should enter a number between 1 and 100.</p>
<form action="r.asp" method="post">
<input type="text" name="first">
<input type="submit" value="Go">
</form>
</html>
----------------------------------
这是一个ASP文件
<body>
<%Dim i=request.querystring("first")%>
<%if i>40 then%>
<h2>Passed</h2>
<%else%>
<h2>Failed</h2>
<%end if%>
</body>

为什么打开后显示“HTTP 500内部服务器错误”?

1:dim i这个要单独一行
2:i=request.querystring("first") 改成i=Request.Form("first")
Post方法提交的用Form接受,Get提交的才用QueryString

<body>
<%
Dim i
i=request.querystring("first")
%>
<%if i>40 then%>
<h2>Passed</h2>
<%else%>
<h2>Failed</h2>
<%end if%>
</body>