Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Module behaving differently when logged in as host
Previous Previous
 
Next Next
New Post 9/12/2008 3:15 PM
Unresolved
User is offline AndySmith
4 posts
10th Ranked


Module behaving differently when logged in as host 

Hello all,

I am very new to DNN though I've been programming in asp.net for a few years and I'm not understanding how modules behave in DNN. We are using 4.08.04.

I've created a new module in visual studio using the starter kit called TestModule. (File -->  New File --> Dot net nuke dynamic module).

I altered the ViewTestModule.ascx Page_Load fuction to call the following code that displays information about the logged in user:

                DotNetNuke.Entities.Users.OnlineUserInfo mRoles = new DotNetNuke.Entities.Users.OnlineUserInfo();
                DotNetNuke.Security.Roles.RoleController mUserRoles = new DotNetNuke.Security.Roles.RoleController();
                DotNetNuke.Entities.Users.UserInfo mUser = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();


                string showroles = string.Empty;
                foreach (string i in mUserRoles.GetRolesByUser(mUser.UserID, mRoles.PortalID))
                {
                    showroles += i.ToString() + ",";
                }


                lblTest.Text = "UserName: " + mUser.Username;
                lblTest.Text += "<br> FullName: " + mUser.DisplayName;
                lblTest.Text += "<br> UserID: " + mRoles.UserID.ToString();
                lblTest.Text += "<br> Roles:  " + showroles;

 

This works fine when I log in as host, the page_load event fires everytime. However if I log out then log in as admin or another user, the page_load event on the user control does not fire. It makes no sense. I tried setting the caching for the module to -1, that didn't help. It seems like the code itself is behaving differently if I'm logged in as "host". Any clues as to what I'm missing here?

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Module behaving differently when logged in as host
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


WEBPC™ DotNetNuke® sites for Small Business
WEBPC™ are internet consultants and web hosters catering to the small business market.
www.webpc.biz
Perpetual Motion Interactive Systems Inc.
A solutions company specializing in Microsoft enterprise technologies.
www.perpetualmotion.ca
Icthus Technologies
Building Faith on the Internet
www.icthustech.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP