2

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?

4

2 回答 2

4

您机器上的 IIS 可能不支持 ASP 执行。

转到程序和功能 -> 打开或关闭 Windows 功能。在Internet Information Services -> World Wide Web Services -> Application Development Features下,验证是否检查了ASP 。

于 2012-07-10T15:44:25.540 回答
3

经典 ASP 默认情况下未安装在 IIS 7.0 和 IIS 7.5 上,请参阅此处此处了解如何在您遇到这种情况时启用它。

从这些链接复制:

在 IIS 7.0 和 7.5 中,默认不安装经典版本的 ASP。因此,当您尝试浏览服务器上的 ASP 页面时,您可能会看到 HTTP 404 错误,或者您可能会在浏览器窗口中看到 ASP 页面的源代码。当未安装用于定义经典 ASP 环境的配置设置时,会创建这两种错误情况。

希望这可以帮助。

于 2012-07-10T16:00:58.013 回答