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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Unable to GetCurrentUserInfo outside in non-dotnetnuke pagesUnable to GetCurrentUserInfo outside in non-dotnetnuke pages
Previous
 
Next
New Post
1/20/2008 4:20 AM
 

Hi Everybody.

I'm building a private messanging system which will be installed on top of our DotNetNuke installation.

In this system, i use prototype window to display the "send message" window on-top of the current displayed page. In this window there is basically an iframe showing an aspx page I've placed inside the dotnetnuke folder. The problem here is that I seem to be unable to user DotNetNuke method in this aspx page.

For example, in this page I'm trying to get the current logged in user's display name and put in the "sender" textbox. I do this using the following line of code: DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().DisplayName;

However, GetCurrentUserInfo() returns null in this case. I assume this is a result of the fact I do not inherit any dotnetnuke base classes (such as portalmodulebase).

Moreover, in some of the modules I'm developing for our website I am using the awesome ajaxpro class library, which allows me to define some methods as ajax method and thus call them from client-side javascript. Yet, in those methods too, I seem to be unable to access the GetCurrentUserInfo() and other dotnetnuke classes.

Is there any other way I can retrieve such information? Does anyone have any suggetions for me?

I thank in advance to anyone who spent the time reading this and trying to help.

Cheers!

 
New Post
1/20/2008 9:55 AM
 

You can use web services:

see: IWeb



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
1/29/2008 11:35 PM
 

Michael suggest using web services. But there is a tricky way. You can do it with client side using JavaScript. :)

When you open a .aspx from dotnetnuke site, then the dotnetnuke site will be the parent. Then you just refer to label or string inside the page of DNN which consist User Info. For example in standard DNN page if you open it in View Source, then you will got like this :

<a id="dnn_dnnUSER_cmdRegister" title="Click Here To Edit Your Account Profile" class="DNN_User" href=" __doPostBack('dnn$dnnUSER$cmdRegister','')">Agung Riyadi</a>

If you use this code in Javascript :

var usr = document.getElementById("dnn_dnnUSER_cmdRegister");

Then you got the refference into login name at runtime. So when you open it in a new window, just call using javascript.

HTH.

CMIIW.

 
New Post
7/22/2010 9:24 AM
 
The easiest way for me to pass information of the user to other non-dnn pages, is to simply pass it in the query string.
So in the dnn page hosting your custom module, build your url (that opens up your non-dnn page) in the code behind and attach any info to the url.

link.Href = "somepage.aspx?USERID=" + DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().UserID.ToString()

hope that helps...
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Unable to GetCurrentUserInfo outside in non-dotnetnuke pagesUnable to GetCurrentUserInfo outside in non-dotnetnuke pages


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