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  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  How to know if user is anonymous?
Previous Previous
 
Next Next
New Post 2/4/2008 8:46 AM
Resolved
User is offline onishiro
143 posts
9th Ranked


How to know if user is anonymous? 

How can I know if a user is not logged in ( anonymous ) from my module?

Thanks in advance.

 
New Post 2/4/2008 8:57 AM
User is offline Ian Robinson
644 posts
www.engagesoftware.com
7th Ranked


Re: How to know if user is anonymous? 

onishiro,

One way is to test the UserId property of the PortalModuleBase class to see if it has a valid value.

take care,

Ian


Ian Robinson
Engage Software
St. Louis, MO
314.966.4000



The leading provider of DotNetNuke support, training and custom development.
 
New Post 2/4/2008 9:51 AM
User is offline Michael Washington
2842 posts
ADefWebserver.com
5th Ranked










Re: How to know if user is anonymous? 

 Ian Robinson wrote

One way is to test the UserId property of the PortalModuleBase class to see if it has a valid value.

for example:

    public partial class View : DotNetNuke.Entities.Modules.PortalModuleBase
    {
            if (UserId != -1)
            {
                lnkAddListing.Text = "[Add My Listing]";
                lnkAddListing.Enabled = true;
            }
            else
            {
                lnkAddListing.Text = "You must be logged in to add a Listing";
                lnkAddListing.Enabled = false;
            }
    }



Michael Washington
* ADefWebserver.com
* DNN Module Developer's Guide
* IWEB - DNN Web Services
* Silverlight and DotNetNuke
 
New Post 2/4/2008 9:53 AM
Accepted Answer 
User is offline Michael Washington
2842 posts
ADefWebserver.com
5th Ranked










Re: How to know if user is anonymous? 

 Michael Washington wrote

for example:   

in VB:

If (UserId <> -1Then
    
lnkAddListing.Text "[Add My Listing]"
    
lnkAddListing.Enabled = true
Else
    
lnkAddListing.Text "You must be logged in to add a Listing"
    
lnkAddListing.Enabled = false
End If



Michael Washington
* ADefWebserver.com
* DNN Module Developer's Guide
* IWEB - DNN Web Services
* Silverlight and DotNetNuke
 
New Post 2/5/2008 3:12 AM
User is offline onishiro
143 posts
9th Ranked


Re: How to know if user is anonymous? 

Thanks Michael.

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  How to know if user is anonymous?
 


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.

 


OnyakTech
Modules for Help Desks, Live Chat, Project Management, CRM, Charting, Reporting, Scrolling Text/Images, Portal Community tools and much more.
www.OnyakTech.com
IHostASP.NET Provides the Ideal DNN Hosting
We will help you with the installation, configuration, and troubleshooting of your DNN portal, no task is too big or small for us. Unlike other companies we are not just providing a reliable hosting service, but we are also focused on providing the best DotNetNuke hosting service on the internet.
www.ihostasp.net
$7.16/mo - Powerful DotNetNuke / DNN Hosting
Powerful DotNetNuke / DNN Hosting on Windows 2008 and 2003 servers, starting at under $8/mo with FREE SQL 2008 on certain plans and FREE SQL 2005 on all plans with FREE Installation and expert support.
www.re-invent.com

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