Attention: We are retiring the ASP.NET Community Blogs. Learn more >

There and back again.

Today I had to call a .NET component from an ASP page so, being the mungey .NET kinda guy that I am I decided to wrap the call in a .NET webservice and invoke a call using an XmlHttp GET request.  It all went fine and I was able to encapsulate most of the harder stuff within the .NET code to make my life easier and add a bit of RAD "oomph" to the overall process.

Then I noticed that the last parameter that was being passed in the sample code that I was following:

this.Request.Url.AbsoluteUri

Ahh, the old Uri.AbsoluteUri trick eh?  Wow, how long has it been since I've had to know what each of the ServerVariables represent again?  :-)  Here was my munged up, ASP code used to build a representation of that string value:

"http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING")

 

No Comments