Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 01, 2012 11:20 AM by oned_gk
Nov 29, 2012 07:19 PM|LINK
Hi masters, I created a folder in my site and it's called "admin". And I added the forms about administrating into this folder. I hid the forms in this folder to users with asp.net configuration manager but I want to add a shortcut for admins. I have a hyperlink
at the bottom of the site called "Admin Control Panel" which directs you to admin panel. But I want to make this button/hyperlink visible only for members who are in the "admin"s group. How can I do that? With loginview or something? Or should I use something
different from hyperlink?
I am waiting your useful tips.
Nov 29, 2012 08:29 PM|LINK
You can do something simple like set hyperlink.Visible = False
and then check to see if (user == admin)
hyperlink1.visible = True
Nov 29, 2012 10:00 PM|LINK
Nov 29, 2012 10:04 PM|LINK
MyPanel.Visible = user.isinrole("admin")
MyLink.Visible = user.isinrole("admin")
Nov 29, 2012 11:44 PM|LINK
I suggest you to use LoginView since it served this purpose. Between, you also have to configure to the Admin Folder to only allow "Admin" role users access to it. This will make sure other users will not able to access it if they have the link from somewhere
*User always can copy & paste the page's url at the browser, not necessary to click on the hyperlink provided.
<allow roles="Admin"/> //Allows users in Admin role
<deny users="*"/> // deny everyone else
Nov 30, 2012 02:27 PM|LINK
First of all thank you for your help!
oned_gk: Thanks for the simple code buddy! Btw can I change this code for the roles I want like
CruzerB: Thanks for your caring. Actually I am using the code that you gave me to hide the admin panel forms in the sitemap. But can it also be used to hide the link? And I am adding this link to make it easier for the admins to login to
admin panel. You know... clicking on a link is faster than writing the url on the address bar.
Dec 01, 2012 09:10 AM|LINK
But can it also be used to hide the link?
It cannot be used to work with Hyperlink control to hide the link.
Dec 01, 2012 11:20 AM|LINK