Brett,
Well, what is the message that is thrown with the exception? That would
help quite a bit.
--
- Nicholas Paldino [.NET/C# MVP]
-
mvp@spam.guard.caspershouse.com
"Brett R. Wesoloski" <brwesoloski@planadmininc.comwrote in message
news:39193C72-66D3-446F-A87C-BF6B43023E91@microsoft.com...
Quote:
>I am having problems using HttpContext.Current.Request.Url.Host.
>
I have some code that does this...
>
if (HttpContext.Current != null)
{
>
subdomain = HttpContext.Current.Request.Url.Host;
>
}
>
Now if I put a break point on the if statement I get this error for the
HttpContext.Current.Request. Request: 'HttpContext.Current.Request' threw
an exception of type 'System.Web.HttpException'
>
Now if I comment out the subdomain = HttpContext.Current.Request.Url.Host;
and stop at the same break point it works fine.
>
Now this seems to be a problem with the 3.5 framework because after I
installed it, this code seemed to not work any more.
>
Any idea's?
>
TIA,
Brett
>