ASP or .NET - how to tell what the server is running?

I also posted this in the Classic ASP forum.

I am a total newb when it comes to either, so can I run a test page to see if the server is running one or either?

Also, in PHP I usually use an include statement to include files that contain common elements like menus or footers. Is there a similar statement in ASP?

To test asp, create a page called test.asp and see if it works (doesn’t error).

To test .net, create a page called test.aspx and see if it works (doesn’t error).

An asp include should work like this:


<%
  <!--#include file="test2.asp"-->
%>

Your host should have this information available, you don’t have to guess it. Bte, forget about ASP, is dead, go only with asp.net

That way of doing includes is very old. A lot better way of doing it is to create a UserControl and insert that on you page. It is a .ascx file. Then you also have something called a Master Page. Which usually contains your sites header, menus and footer. With a content section or more depending on your needs. Then each aspx page points to the master and you put your code into those content blocks declared on the master page.

Just to clarify, you’re describing how .net works. The question regarding includes was about asp.

If creating a new site or whatever do not bother with classic ASP forget it even exists. IT IS A DEAD LANGUAGE.

If the site has an asp extension, it is probably ASP. If it has a /bin folder with some .dll files, it is probably .NET. Server generally is capable of running both.

I second what logic_earth said.

Thanks for all the replies. I did the test Renkai suggested and got errors, so that answers my question :frowning:

One of the easiest way of checking it is knowing what .net version installed.
Create a page with this javascript
javascript:alert(navigator.userAgent)

open that on IE. It should tell you the .net version installed if any.

Alternatively you can simply create a test script with .net code on it see if that runs.

That is all fine and good – if you want to know what version of .NET the computer with that instance of IE is running. It won’t tell you in any way what the server is running.