Professional Shared, Reseller and Dedicated DotNetNuke Hosting Cheap and reliable DotNetNuke hosting service provider - DNNMart LiveZilla Live Help

DotNetNuke Hosting Customer Support Center

Main Menu
Home
Open a Ticket
My Ticket History
Browse Knowledgebase
My Account

Login
 E-mail:
 Password:
Register | Forgot Password?

Knowledgebase
Ask a question using natural language. Try to include as much information as possible:


Contact Us
Database Mart LLC
7017 Weis Drive
Galveston, TX 77551
USA
409-877-4238

Sales & Billing: 8:00AM-5:00PM CST
Technical Support: 24x7x365

Knowledgebase
How to get current domain name in ASP.NET?
Top : General Technical Support : Programming

Article ID: 000053
Rating: 5.0 / 5.0 (1 votes)
Views: 3524

Problem
How to get current domain name in ASP.NET?

Solution
Public Shared Function GetCurrentDomainName() As String
Dim domain As String

domain = HttpContext.Current.Request.ServerVariables("SERVER_NAME")
domain = domain.Replace("www.", "")

Return (domain)
End Function

Rating
Did you find this article helpful?

Related Articles
How to get user IP in ASP.NET?

Shared DotNetNuke Hosting - Reseller DotNetNuke Hosting - Dedicated DotNetNuke Hosting - Domain Registration - SSL Certificates
Home - Support Center - Knowledgebase - Documentation - Flash Tutorials - How To - Our Network - About Us - Site Map
Cheap and reliable DotNetNuke hosting service provider - DNNMart