SimonD
SimonD

Reputation: 1547

ASP script is not run

I'm asp newbie and trying to run this simple asp script from here: http://www.w3schools.com/asp/asp_inputforms.asp

This is my form.html file:

<html>
<body>
<form method="get" action="form2.asp">
First Name: <input type="text" name="fname" /><br />
Last Name: <input type="text" name="lname" /><br /><br />
<input type="submit" value="Submit" />
</form>
</body>
</html>

This is form2.asp file:

<html>
<body>
Welcome
<%
response.write(request.querystring("fname"))
response.write(" " & request.querystring("lname"))
%>
</body>
</html>

I launch form.html file from inetpub/wwwroot folder, enter name and last name and get in browser:

Welcome <% response.write(request.querystring("fname")) response.write(" " & request.querystring("lname")) %>

Localhost is open for me. What am I doing wrong?

Upvotes: 2

Views: 2128

Answers (2)

Ofer Zelig
Ofer Zelig

Reputation: 17480

IIS on your machine probably does not support ASP execution.

Go to Programs and Features -> Turn Windows features on or off. Under Internet Information Services -> World Wide Web Services -> Application Development Features, validate that ASP is checked.

Upvotes: 4

03Usr
03Usr

Reputation: 3435

Classic ASP is not Installed by default on IIS 7.0 and IIS 7.5, see here and here to see how to enable it if this is the case for you.

Copied from these links:

In IIS 7.0 and 7.5, the classic version of ASP is not installed by default. Because of this, you might see HTTP 404 errors when you try to browse to an ASP page on your server, or you might see the source code for your ASP page displayed in your browser window. Both of these error conditions are created when configuration settings that are used to define the environment for classic ASP are not installed.

Hope this helps.

Upvotes: 3

Related Questions