Solved

Show control if user logged in

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

12 Experts available now in Live!

Get 1:1 Help Now