ASP Server Variables, Request Object and Browser Caps

There are a lot of posts in the ASP.NET forums about the ServerVariable object and I also find myself again and again trying to figure out what property really contains which information. So the easiest way is always to just quickly try it out.

In order to once and for all solve this issue, I put together a little page that lists all properties from the Request.ServerVariable collection.

In addition it also prints out some of the other interesting Request and all Request.Browser properties.

Example (Not live)
The code (in html)
ServerVariables.aspx (in a zip)

 

Summary
List all Request.ServerVariable properties:

<%foreach(string name in Request.ServerVariables){%>
<tr>
    <td>
        <%= name %>
    </td>
    <td>
        <%= Request.ServerVariables[name] %>
    </td>
</tr>
<% } %>

Other Request objects:

<%= Request.ApplicationPath %>

Browser Caps:

<%=Request.Browser.Browser %>

Good luck!




Ähnliche Beiträge


Leave a Reply

Your email address will not be published. Required fields are marked *



*