Solved

Visual Basic.net Hide Div based on login name

Posted on 2009-05-11
3
564 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

837 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