metadata Posted August 9, 2012 Share Posted August 9, 2012 (edited) 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! Edited August 9, 2012 by metadata Link to comment Share on other sites More sharing options...
justsomeguy Posted August 9, 2012 Share Posted August 9, 2012 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 More sharing options...
metadata Posted August 9, 2012 Author Share Posted August 9, 2012 Yes I see now, I missed something in opening the file using notepad. Link to comment Share on other sites More sharing options...
metadata Posted August 9, 2012 Author Share Posted August 9, 2012 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 More sharing options...
justsomeguy Posted August 9, 2012 Share Posted August 9, 2012 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 More sharing options...
metadata Posted August 9, 2012 Author Share Posted August 9, 2012 Shouldn't Windows 7 have IIS already on it which basically turns a PC into a web server of sorts? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 9, 2012 Share Posted August 9, 2012 IIS isn't installed by default, if your version of Windows includes it then you can install it like this: http://www.howtogeek.com/howto/windows-vista/how-to-install-iis-on-windows-vista/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now