Now that I think for a minute (getting so used to parsing), the System.Uri
object makes things even simpler. Try:
System.Uri url = Request.Url;
string hostname = url.Host.ToString();
In VB.NET:
Dim url As System.Uri = Request.Url
Dim hostname As String = url.Host.ToString()
---
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Jonny Wilkinson" wrote:
Hi
I need to be able to determine the domain name the web page has been called
from. I have a site that can be accessed through different domain names
(they all point to the same IP address) eg. www.abc.com and www.bcd.com
Is there a way to do this in the ASPX code in C#
Many thanks
Jonny
P.S I did post this message before but it didn't show up in my news reader.