0

In Classic ASP, Submitting values from one page are not being able to fetch from Request.Form on another page in Windows 2008 Server 64 Bit, It gives HTTP 500 error. However I am able to view normal Response.Write quoted text in my browser. I am new to ASP Classic.

Index Page :: This is the index page whose values are to be traversed to another page.

<HTML>
<HEAD>
</HEAD>
<BODY>
<Form Method="POST" Action="ValidateUser.asp" Name="IndexPage" Id="IndexPage" target="ValidateUser">
<CENTER><H1><%Response.Write ("Welcome to PuneDiary..")%></H1>
<BR>
<BR>
<table>
<tr>
<td colspan="2" align="center">Login</td>
</tr>
<tr>
<td>User Name : </td><td><input type="text" name="txtuname" value="<%=txtuname%>"/></td>
</tr>
<tr>
<td>Password : </td><td><input type="password" name="txtpass" value="<%=txtpass%>"/></td>

</tr>
<tr>
<td></td>
<td align="Right">
<input type="Submit" Value="Submit"/>
</td>
</tr>
</table>
</CENTER>

</Form>
</BODY>
</HTML>

--------------------------------------------------------------------

Validate User Page :: This is the page which takes input from the Index Page.

ValidateUser.asp

<!DOCTYPE html>
<HTML>
<HEAD>
<script language="vbscript" runat="server"/>
</HEAD>
<BODY>
The Data to be displayed is:<BR>
<%
Call ValidateUser()

Public Sub ValidateUser()

Dim Uname,Pass

UName = Request.Form("txtuname")
Pass = Request.Form("txtpass")

Response.Write (UName & "<BR>")
Response.Write (Pass)

End Sub

%>

</BODY>
</HTML>
4

3 回答 3

1

由于您使用的是 windows 2008 服务器,它带有 IIS 7.0 及更高版本。Classic ASP Not Installed by Default on IIS 7.0 和 IIS 7.5,您需要进行必要的设置。请通过以下链接

http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-not-installed-by-default-on- iis

于 2013-06-26T07:59:21.433 回答
0

您在程序结束时丢失并“结束子”。像这样使用 Sub 没有任何意义。

你可以简单地这样做:

Dim Uname,Pass

UName = Request.Form("txtuname")
Pass = Request.Form("txtpass")

Response.Write (UName & "<BR>")
Response.Write (Pass)
于 2013-06-26T06:42:55.123 回答
-1

我认为你需要失去这<script language="vbscript" runat="server"/>条线。经典 ASP 中没有“runat”属性,这可能会导致 IIS 尝试将页面加载为 ASPX 文件,其中会使 VB 脚本代码完全不兼容并引发 HTTP 500 错误 - 这将是有意义的无论友好的错误消息或向浏览器发送错误(或任何其他 IIS 设置,真的),都会收到 500 错误。

这是我的理论,至少。尝试删除该行,看看会发生什么。

于 2014-03-27T00:04:55.630 回答