what is Request.ServerVariables

A

Andy Fish

Hi,

I just came across the HttpRequest.ServerVaraibles collection which the
documentation helpfully explains contains "a collection of server variables"

What on earth is a server variable? where do these variables come from? what
variables can I expect to be present? what do they mean? I can't find any
documentation in MSDN at all.

TIA

Andy
 
T

Teemu Keiski

They are preset variables containing information about the server and the
request. Like version of the server software, name/type of the server (IIS)
and so on.
 
A

Andy Fish

Thanks

It seems strange that the asp.net documentation only makes a passing
reference to it.

I notice that your link refers to "classic" asp (pre dotnet). Is the server
variables thing provided mainly to ease porting of pre .net apps?
 
J

Juan T. Llibre

re:
I notice that your link refers to "classic" asp (pre dotnet). Is the server variables
thing provided mainly to ease porting of pre .net apps?

That's because the server variables are being provided by IIS,
which is the http server infrastructure which both ASP and
ASP.NET extend.

Both ASP and ASP.NET can access IIS's Server Variables.

Many, though not all, are available through the HttpRequest class in
System.Web ( the Request object ) if you wish to use native ASP.NET methods.

See :

http://www.csharpfriends.com/quicks...d50a3a&namespace=System.Web&class=HttpRequest
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,263
Messages
2,571,064
Members
48,769
Latest member
Clifft

Latest Threads

Top