Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Dynamic gridview content based on user role?

Reply
Thread Tools

Dynamic gridview content based on user role?

 
 
Troy Dot Net
Guest
Posts: n/a
 
      01-09-2006
I have a page that displays SQL Server tables via GridView controls.
However, some of the table fields (gridview columns) should be visibile only
to specific users (Admin, Supervisors, etc) and some should be
visible/editable only by specific users (Admin). I would like a simple,
robust method of dynamically enabling/disabling content based on the user's
role. I'm using ASP.Net 2.0/C# within VS2005TS and SQL Server 2000 (can also
use 2005 express).

Any suggestions? Thanks for your advice.

Troy

 
Reply With Quote
 
 
 
 
MikeS
Guest
Posts: n/a
 
      01-22-2006
Will something like this work?
<control enabled='<%=Roles.IsCallerInRole("Admin")%>'>

 
Reply With Quote
 
 
 
 
Troy Dot Net
Guest
Posts: n/a
 
      01-23-2006
> Will something like this work?
> <control enabled='<%=Roles.IsCallerInRole("Admin")%>'>


I believe that will work, though that's the easy part. The hurdle is how to
define which controls require which role(s) to be viewable and which controls
require which role(s) to be editable (and maybe again for deleteable).
Making this system scaleable, foolproof and manageable is the hard part.

Thanks for the lead.

Troy
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
Re: Authentication and user based content Eliyahu Goldin ASP .Net 2 04-14-2008 03:11 PM
Dynamically Setting Up a Gridview Based on Data Content Brett ASP .Net Web Controls 3 01-08-2008 03:35 PM
Injecting a User Control / Control into a content dynamic content Kurt ASP .Net Web Controls 0 06-13-2007 08:54 PM
Dynamic resizing of iframes based on content height Peter Javascript 1 05-08-2005 10:31 PM



Advertisments