what is Request.ServerVariables

  • Thread starter Thread starter Andy Fish
  • Start date Start date
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
 
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.
 
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?
 
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






Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
 

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

Back
Top