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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Accessing the DNN UserID in a non-DNN page.Accessing the DNN UserID in a non-DNN page.
Previous
 
Next
New Post
10/12/2010 12:39 PM
 
I have a similar problem. I would like to pass the current users name and email address to an asp (not aspx) page. Can this be done? Is there a way to include this information in the querystring, as part of the pages url?
 
New Post
12/28/2010 2:01 AM
 
Anyone? I've scoured the web but I don't see any resolution to this problem.
 
New Post
12/28/2010 10:12 AM
 
Andrew Woomer wrote:
Is there a way to access the DNN UserID on a regular aspx page in my DNN install? I thought if I imported a few of the namespaces, maybe I could but it doesn't seem to be the case.

Thanks

Hi,
Download the  "DNN Search & Replace" found at http://www.evotiva.com/downloads.aspx. it is a standalone ASPX and it 'knows'  the current DNN user. If I understood the problem, reading this ASPX file will answer the question.
Thanks,
Horacio.-

 
New Post
12/28/2010 11:18 AM
 

Here is some code that will load portal settings and get the current user id.

Dim _portalSettings As DotNetNuke.Entities.Portals.PortalSettings
Dim _userId as Integer = -1
If Not HttpContext.Current.Items("PortalSettings") Is Nothing Then
    _portalSettings = CType(HttpContext.Current.Items("PortalSettings"), DotNetNuke.Entities.Portals.PortalSettings)
Else
    Dim objPortalAliasInfo As DotNetNuke.Entities.Portals.PortalAliasInfo = Nothing
        Dim sUrl As String = HttpContext.Current.Request.RawUrl.Replace("http://", String.Empty).Replace("https://", String.Empty)
        objPortalAliasInfo = DotNetNuke.Entities.Portals.PortalSettings.GetPortalAliasInfo(HttpContext.Current.Request.Url.Host)
        _portalSettings = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings()
End If
If HttpContext.Current.Request.IsAuthenticated Then
    UserId = UserController.GetUserIdByUserName(PortalId, HttpContext.Current.User.Identity.Name)
End If

Will Morgenweck
VP, Product Management
DotNetNuke Corp.
 
New Post
12/28/2010 11:25 AM
 
Thank you very much, Will! I had been searching for this for a week. 
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Accessing the DNN UserID in a non-DNN page.Accessing the DNN UserID in a non-DNN page.


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