Solved

Visual Basic.net Hide Div based on login name

Posted on 2009-05-11
3
563 Views
Last Modified: 2012-05-06
I am trying to figure out how to only show a div if a certain user is logged in.  I am using VB.net and Visual Studio 2005

ie.  <div id="Michael"> </div>

If LoggedIn = Michael then div.show

etc
0
Comment
Question by:Albee_J
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
mohan_sekar earned 500 total points
ID: 24355537
Add runat="server" to your div tag and set visible = "false" by default.
Then,
If 'LoggedIn' then
 <divname>.visible = true
End If
0
 

Author Comment

by:Albee_J
ID: 24356259
What is the correct syntax for this line

If 'LoggedIn' then

I can't get it to work
0
 

Author Comment

by:Albee_J
ID: 24356390
nevermind blonde moment figured it out

    If User.Identity.Name = "michael" Then
            Michael.Visible = True
        End If
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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