Solved

Show control if user logged in

Posted on 2006-06-27
1
221 Views
Last Modified: 2010-05-18
Hello experts,

I currently have two <Div>s, I want to display one or the other if a user is logged in or not.

1. What controls should I place the <Div>s in. (LoginView is not an option)
2. What is the code in my codebehind that I will use to display one or the other dependent on the criteria being met


Many Thanks
0
Comment
Question by:claracruz
1 Comment
 
LVL 2

Accepted Solution

by:
tom_miller earned 500 total points
ID: 16997413
      Use the Panel Control

string UserName = User.Identity.Name;
        if (UserName != "")
        {
            panelMember.Visible = true;
            panelNonMember.Visible = false;
        }
        else
        {
            panelMember.Visible = false;
            panelNonMember.Visible = true;
        }
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DLL in ASP.NET 20 56
Runtime Error 2 28
Remove greater than sign 3 42
Replace &lt; with < 14 54
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now