Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...GetDomainName(Request)GetDomainName(Request)
Previous
 
Next
New Post
9/19/2006 7:26 AM
 

In one of my Modules, I need to extract the name of the Domain

I did this

------------------------------------

Dim PortalName As String = GetDomainName(Request)
Dim WebDomainName As String = AddHTTP(Left(PortalName, InStrRev(PortalName, "/") - 1))

------------------------------------

But, for some reason, at times, the PortalName variable remains blank (and the module just does not work, and gives error as "Object reference not set ....")

What I am doing wrong ? What is the most reliable method to get the DomainName ?

 
New Post
9/19/2006 12:38 PM
 

I use portal settings something like:

Dim PortSet As DotNetNuke.Entities.Portals.PortalSettings
PortSet = PortalCont.GetCurrentPortalSettings

for the portal alias (will that work for you?)
tempstr2 = PortSet.PortalAlias.HTTPAlias

I haven't seen it give me problems.

mj


Michael Jackson
Brillnat.com
Custom module development
Database access tokenized HTML modules
 
New Post
9/20/2006 12:06 AM
 

Thanks Michael,

I guess, that should work for me :) [I, ofcourse, would need to truncate the folder, if any, I guess]

I also tried Request.ApplicationPath

However, my big question is, why the GetDomainName(Request) does not work ? :( Also, what is the performance difference between such various methods ?

I further suggest that the domain name ( without the folder, i.e. http://www.mydomain.com and not the http://www.mydomain.com/mydnnfolder ) should be part of the standard properties of PortalModuleBase, so that it is accessible any when needed.

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...GetDomainName(Request)GetDomainName(Request)


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out