Solved

Show control if user logged in

Posted on 2006-06-27
1
222 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

772 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