HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...find if logged in?find if logged in?
Previous
 
Next
New Post
4/23/2008 2:16 AM
 

Hi,

How can find out if any user is logged in to the DNN website. I want to check if any user is logged in and display a page differently (for logged in user and not logged in visitors).

One more Qs which is not exactly connected to DNN. I have a datalist with a select and a custom button. I want to display those button only if the user if logged in  otherwise the user would just see the data not those buttons. How to go about this. I think I can check out if user is logged in and hide teh button otherwise. But is it possible to hide/display buttons in a datalist conditionally . I mean, the button inside a datalist can't be accessed from outside right? Pls guide.. i am a bit new to all these ;-(
 

 
New Post
4/23/2008 3:56 AM
 

to display modules for authenticated / unauthenticated users only, grant view permissions to the appropriate virtual user roles.

For separate questions of different areas I suggest to use individual posts in the appropriate Forums.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group   European Network of DotNetNuke Professionals

 
New Post
4/24/2008 7:10 AM
 

HttpContext.Current.User.Identity.IsAuthenticated will be true or false depending on whether the current user is anonymous or logged in to your site.

So if you had a button named btnSelect.. you could just set the visible attribute in your page load based on that value.

btnSelect.Visible = HttpContext.Current.User.Identity.IsAuthenticated

EDIT: Sorry just noticed you are talking about buttons in a datalist, so you'd  have to put that code in your ItemDatabound function for your datalist. Then for each row as it's being bound, fnd the button control using teh FindControl() method and set it's visibility as described.





 
New Post
4/27/2011 12:13 AM
 
Or, even shorter:
Request.IsAuthenticated
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...find if logged in?find if logged in?


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.

Attend A Webinar
Try An Online Demo
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

DotNetNuke Scoop!

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft .NET. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates Snowcovered.com where users purchase third party apps for the platform.