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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...find if logged in?find if logged in?
Previous
 
Next
New Post
4/23/2008 4: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 5: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

Speed up your DNN Websites with TurboDNN
 
New Post
4/24/2008 9: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 2:13 AM
 
Or, even shorter:
Request.IsAuthenticated
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...find if logged in?find if logged in?


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