Digital Colony!

Detect ASP.NET Version Running on Server

Below is a handy script that you can drop onto any server running any version of ASP.NET. When you load the page into the browser, it will report back to you which version of ASP.NET the current web site is configured to run.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        lblVersion.Text = System.Environment.Version.ToString();
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ASP.NET Version Checker</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>     
        <p>.NET CLR Version: 
        <strong><asp:Label ID="lblVersion" runat="server" /></strong></p>
    </div>
    </form>
</body>
</html>

Labels: ,

AddThis Social Bookmark Button

3 Comments:

Anonymous Anonymous said...

Thank You.
(works as advertised)

10/13/2007 7:57 PM

Blogger Bruno Amaral said...

Hello Michael.

I need to know the version and the type of web server (IIS, Apache, TomCat...) of the anything web application.

Do yow know?

Thanks.

Merry Christmas.

Bruno Amaral (Brazil)

12/21/2007 8:40 AM

Blogger MAS said...

Bruno,
Try this:
Request.ServerVariables["SERVER_SOFTWARE"]

I wish I was in Brazil right now. It is very cold here in Seattle.

MAS

12/21/2007 8:51 AM

 

Post a Comment

 

Digital Colony Copyright © 1999-2008 XHTML   508
This site uses Blogger, which is not 100% XHTML compliant.
Try...Catch Disclaimer: For brevity many examples do not include error handling. That is your responsibility.