Jump to content

asp file extensions


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 post
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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...