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>
Ajinkya
  • 35
  • 1
  • 8
  • What is the nature of the HTTP 500 error? Make sure your browser has "Freindly Error Messages" turned off and provide the error details. – Jon P Jun 26 '13 at 06:56
  • An error occurred on the server when processing the URL. Please contact the system administrator. This is the error message being displayed when "Friendly Error Messages" are turned off. – Ajinkya Jun 26 '13 at 07:01
  • Actually that sounds like the "Friendly HTTP Error Message" makesure the chekcbox is unchecked. Normaly you'd get line numbers etc – Jon P Jun 26 '13 at 07:03
  • Here in this case there is no line no. being displayed inspite of the "Friendly Error Messages" being turned off. Is there a problem with the IIS 7 configuration, as for Classic ASP we need to configure it first as it is not preconfigured on Windows 2008 Server. – Ajinkya Jun 26 '13 at 07:16
  • See: http://stackoverflow.com/questions/8761631/classic-asp-on-iis-7-windows-server-2008-64-bit-in-32-bit-mode for enabling debugging on your server. On the server make sure you have "Send Errors to Browser" enabled – Jon P Jun 26 '13 at 07:35

3 Answers3

1

since you are using windows 2008 server, it comes with IIS version 7.0 and above. Classic ASP Not Installed by Default on IIS 7.0 and IIS 7.5, you need to make necessary settings. please go through below link

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

Anup
  • 36
  • 5
0

You are missing and "End Sub" at the end of your procedure. Using a Sub like this makes no sense.

You can simply do this:

Dim Uname,Pass

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

Response.Write (UName & "<BR>")
Response.Write (Pass)
Krisztián Balla
  • 19,223
  • 13
  • 68
  • 84
  • Jenny, Sorry that was a typo mistake while posting the code, the End Sub is already present still I am getting HTTP 500 error. – Ajinkya Jun 26 '13 at 06:51
  • Did you try removing your script tag? It doesn't serve any purpose. Do you get any more info on the error? – Krisztián Balla Jun 26 '13 at 06:57
  • After removing the script tag, the browser displays the string placed in <% Response.Write("

    The Data to be displayed is:


    ")%> however the succeeding code in Sub...End Sub is giving the error as "An error occurred on the server when processing the URL. Please contact the system administrator."
    – Ajinkya Jun 26 '13 at 07:13
-1

I think you need to lose the <script language="vbscript" runat="server"/> line. There is no "runat" attribute in classic ASP, and that might be causing IIS to try to load the page as an ASPX file in which would make the VB Script code completely incompatible and throw the HTTP 500 error - and it would make sense to get the 500 error regardless of friendly error messages or sending errors to the browser (or any other IIS settings, really).

That's my theory, at least. Try removing that line and see what happens.

Dave Mroz
  • 1,509
  • 2
  • 14
  • 27
  • Care to elaborate? – Dave Mroz Dec 06 '16 at 14:48
  • Of course. Classic ASP supports ` – Toothbrush Dec 06 '16 at 15:18
  • Obviously, he should have used `<%@ Language="VBScript" %>` at the top of the page. An empty script block won't do anything. – Toothbrush Dec 06 '16 at 15:20