Jump to content

asp file extensions


metadata

Recommended Posts

I am new to asp and am wondering what extension you are supposed to use for an asp file. In some of the examples on the site it showed ".asp" as the extension for these files. An example below:

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

Now, is this what the filename's extension should actually be or should it be .html? I named my file with a .asp extension but I am unable to open it in notepad for editing so I'm thinking it should be .html. Thanks! :Unsure:

Edited by metadata
Link to comment
Share on other sites

ASP classic files should have a .asp extension, ASP.NET files should have a .aspx extension. Notepad will open any file you tell it to, even a binary file. It's not useful to open a binary file in Notepad, but it won't complain.

Link to comment
Share on other sites

I have another question. I opened the file.asp with notepad and put the following code inside from an exaple on the site:

<!DOCTYPE html><html><body><%response.write("Hello World!")%></body></html>

The page that comes up in my browser displays the following: <% response.write("Hello World!") %> What does this mean? It should only display Hello World! if working properly. Thanks

Link to comment
Share on other sites

That means that ASP isn't running. If you're double clicking on the file to open it, that doesn't work with server-side languages like ASP and PHP. They require a web server with the necessary software to execute the server-side code. You'll need to put that file on a web server that supports ASP and access it with a URL that starts with HTTP.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...