Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > Visual Web Developer 2005
|
Visual Web Developer 2005 Discuss creating ASP.NET 2.0 sites with Microsoft's Visual Web Developer 2005. If your question is more specific to a piece of code than the Visual tool, see the ASP.NEt 2.0 forums instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Web Developer 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 26th, 2009, 08:17 AM
Registered User
 
Join Date: Feb 2009
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
Default Link Display based on role authentication

hi,

I want to be able to display a particular link based on role authentication.
The page is visible to all user including administrator .But, different links are meant to be visible based on the role of the logged in user



thanks
 
Old February 26th, 2009, 10:22 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You can hide the link from code behind using syntax like this:

MyLink.Visible = Context.User.IsInRole("Administrator");

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
kaforad (February 27th, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Role based security tsimsha ASP.NET 2.0 Basics 4 May 6th, 2008 11:41 AM
Authentication and Role-Based Security swandown ASP.NET 1.0 and 1.1 Basics 0 October 11th, 2004 04:07 PM
Role based securty Warbird General .NET 2 August 17th, 2004 12:50 PM
ASPX role authentication digriz60 ASP.NET 1.0 and 1.1 Basics 3 November 5th, 2003 11:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.