Solved

Show control if user logged in

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web site error 3 44
Jquery datatables integration with ASP.NET MVC, bootstrap 3 22
asp.net input html code have it display the content 2 22
FInd Image Control Gridview 3 21
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 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