How to disply content in div to role

Hi, i have a div box, and i want it to only be visible to a specified role group.

So for example, i have Role1, Role2, Role3, i want the div named "divCom" to be visible to the users in roles 1 and 2, but not visible to role 3.

I have started by setting the divCom visible property to false.

Anyone know what i could do to achieve this?

0
richard112
5/4/2009 9:09:18 AM
asp.net.security 27051 articles. 1 followers. Follow

3 Replies
982 Views

Similar Articles

[PageSpeed] 1
Get it on Google Play
Get it on Apple App Store

You will probably want to use a login view control on your page to make things simple.

The code would go a little like this: 

<asp:LoginView ID="loginvew" runat="server">
    <RoleGroups>
    <asp:RoleGroup Roles="Role 1">
    <ContentTemplate>
Role 1 can see this text.
    </ContentTemplate> 
    </asp:RoleGroup>
    <asp:RoleGroup Roles="Role 2">
    <ContentTemplate>
This is only visible to role 2.
    </ContentTemplate> 
    </asp:RoleGroup>
    </RoleGroups> 
   </asp:LoginView>
 
~Don't forget to mark my post as the answer if it helped~

Community Site | Personal Site
0
bohunt
5/4/2009 5:09:13 PM

Ok thanks

0
richard112
5/4/2009 8:02:02 PM

Don't forget to mark my post as the answer so users know it has been answered and can use it as a refrence if needed.


~Don't forget to mark my post as the answer if it helped~

Community Site | Personal Site
0
bohunt
5/4/2009 8:48:57 PM
Reply:

Similar Artilces:

Duplicate Security Roles Showing up In Security Roles Manager
Anyone have any ideas?  We have had and instance of 3.0.13 with one child portal running for about a month now.  A few days ago our adminstrator noticed that we have duplicate entries for security roles. For example, the Security Roles Manager shows:Name Description Fee Every Period Trial Every Period Public Auto   Administrators Portal Administration         False False   Administrators Portal Administration         False False  Registered Users Registered Users    &n...

Why is it an error to have both X-Content-Security-Policy and X-Content-Security-Policy-Report-Only ?
https://wiki.mozilla.org/Security/CSP/Spec#Report-Only_mode If both a X-Content-Security-Policy-Report-Only header and a X-Content-Security-Policy header are present in the same response, a warning is posted to the user agent's error console and any policy specified in X-Content-Security-Policy-Report-Only is ignored. The policy specified in X-Content-Security-Policy headers is enforced. Why is this? This seems like an unnecessary burden which prevents groups from tightening their security policies over time. For example, here at Google, I'm interested in helping resol...

Roles, roles, roles
Hey is it posible o have a role for a user to only update the content? I don't want that user to change skins or to make other admin changes... up I think if you allow a role to edit contents on a module level he wont be able to change anything else. Did you try that? cheers, erikErik van Ballegoij, The Netherlands if you allow a role to edit contents in a module lets say discussions module, then that role will be able to edit, delete the threads. so for a role to be able to add new thread only, do we need to write our own code?-keeara g------------------ keeara, see...

Problems implementing role security (.Net 1.1)
I'm having a problem implementing role based security.  Here's my code:   Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs) ' Fires upon attempting to authenticate the use If Not HttpContext.Current.User Is DBNull.Value Then If HttpContext.Current.User.Identity.AuthenticationType = "Forms" Then Dim id As Web.Security.FormsIdentity = CType(HttpContext.Current.User.Identity, Web.Security.FormsIdentity) Dim ticket As Web.Security.FormsAuthenticationTicket = id.Ticket Dim userData As String = ticket.User...

Using .net Security & Roles in SQL 2000 on the internet
I am working on setting up ASP.Net Security & Roles on a website hosted by GoDaddy.  My site is using the SQL 2000 server.  I have my code working on my laptop using SQL 2000 Server.  What I need to know is how do I create roles in the Sql 2000 server tables, which is hosted by GoDaddy?  I have successfully created roles using the Visual Studio ASP.Net Configuration page, but this only configures my local SQL server, not the one on Godaddy.  Any suggestions would be greatly appreciated.   David Hi This article might help: Remote Membership/Roles Manag...

Authorization Manager (AzMan) -v- .NET role based security
Comparing Windows Authorization Manager (AzMan) with .NET role based security, consider an application with these requirements: The roles which will exist at run time are completely user-definable. Role/operation assignments are completely user-definable. Need hierarchical role support (create roles from other roles). Users may be assigned different roles for different things. Windows Authorization Manager seems to provide all the above, with user definable roles, operations, role/task/operation assignments, hierarchical roles, "scopes" to give users different roles for differe...

.NET Security Roles and Management, using multiple tiers / levels
We have one application that we will be re-writing soon. To say it simply, the security and premissions in it is very complex.Can the management and role classes in .NET 2.0 handle this sort of situation:-Multiple Items.-Multiple Departments-Multiple Staff in each department.Staff members can have the ability to view items in their own departmentStaff Members can have the ability to view items in other departmentsStaff members can have the ability to view items in no departments.Staff members can have the ability to view all items.STaff members are in departments.There can be X number of de...

Configuring Roles and Security within VS.NET to use SQL2000/Access
Hi   Is there anyway to get the roles and security controls to use an EXISTING database which is either SQL2000 or an Access 2000 database? TIA and regards John Here's a post explaining how to hook up the ASP.Net v2 security to SQL Server 2000 or 2005. ...

Managing security
Hi all I've been helped out a lot with regards to roles/ membership etc. but have a couple of queries. I have a group of people who have the role of PracticeManager. These people log in and are then forwarded to a folder/pages whereby they can submit documents relating to schemes they are involved in. Each user on logging in must only see content which is specific to them. e.g. Documents that they have uploaded and database content that they have created. Each user will upload similar documents and create similar rows in a database but cannot be allowed to view other peoples submissi...

Mixed Secure and Non Secured Content
I didn't get a feel for how safe SSL pages are that contain both secure and non secured content. If a page contains both is the secured content (say a form or password entry) safe? John John Pearce wrote: >I didn't get a feel for how safe SSL pages are that contain both secure >and non secured content. If a page contains both is the secured content >(say a form or password entry) safe? Depends on what's secure and what isn't. For example, if it's just graphics that are insecure, you're fine. It's the code itself (HTML plus possibly...

Security Error: Content at http://googleads.g.doubleclick.net/ may not load data from
e.g., "Security Error: Content at http://googleads.g.doubleclick.net/ may not load data from http://example.com" Does anyone have an explanation for these entries in the Firefox Error console. I have searched with Google but can find nothing but questions and speculation. -- ***************************** Chuck Anderson • Boulder, CO http://www.CycleTourist.com Turn Off, Tune Out, Drop In ***************************** On 11.02.2009 00:20, CET - what odd quirk of fate caused Chuck Anderson to generate the following:? : > e.g., "Security Error: Co...

Content not going inside the contents div tag
I have an intermittent issue. Sometimes the content of the master/content page does not go inside in the div tag for the content control.  This is what happens at times  <div id="MainContentDiv" style="height:100%;"></div> <ACTUAL CONTENT>  The correct thing is  <div id="MainContentDiv" style="height:100%;"><ACTUAL CONTENT></div> Can anybody help me in figuring out the problem. Thanks for your help.Jaitley Hi, We never encounter this problem, but it seems is not easy to reproduced. ...

Security administration, assign a role to the role domain
Hi, Should that be possible or not? Looking at the GUI it should but I get "Failed to create 1 role assignment request(s). You are unauthorized for this operation.". A work around is to create a group but why involve a group when all users that should be able to assign members to specific roles already are in a role for those administrators? Best regards, Tobias Tobias, It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply. Has your problem been resolved? If not, you might...

Public role and auto assign under security roles
Greetings, What do the check boxes public role and auto assign under security roles mean and how does one use them? Thanks in advance, Dave Public role means that users can choose to "join" those roles by selecting the checkboxes for those roles at the bottom of their user profile page. Auto Assign assigns new registered users to that particular role automatically. HTH JeremyJeremy WhiteWebstone, LLCMy DNN Blog...

Web resources about - How to disply content in div to role - asp.net.security

Help:Contents - Wikipedia, the free encyclopedia
Templates are special pages that contain boilerplate text intended to be displayed on more than one page in Wikipedia. This Tip of the day box ...

Portal:Contents/Culture and the arts - Wikipedia, the free encyclopedia
The word culture is derived from the Latin root cultura or cultus meaning to "inhabit, cultivate, or honour". In general, culture refers to human ...

A-B InBev Extends NBA Sponsorship, Gains Content Rights
... sports league sponsorships after extending its NBA deal for another four years. The renewal, which was announced today, includes a new content ...

The Top 5 Facebook Holiday Content Ideas
The holiday season is officially in full swing and content publishers everywhere know what that means: Tis’ the season to be seen and heard with ...

Artsy has new content and is ready for Miami Art Week
... world close at hand with Artsy , then an update today, Dec. 2, will inspire you even more. The apps new version entitled Fresh brings new content ...

DirecTV will broadcast live 4K content by “early next year”
(credit: Adam Melancon ) Even if 4K TVs were popular Black Friday and Cyber Monday steals, there continues to be a lack of 4K content to watch ...

How to extract the contents of a setup file without installing it first
... only exist as a way to get adware onto your system, sometimes without you even noticing. One way to avoid this is to extract the contents of ...

10 Ways to Recycle Old Blog Content
... Add a Pinworthy and Instagram-worthy image. Use Picmonkey because it's awesome. Add links to related posts you've written. Update content ...

Why content is ‘not’ king and never has been
... been in the search marketing industry for over a decade, and I don’t think a year has gone by in which I haven’t heard the expression ‘content ...

IDG Contributor Network: Is relying on a single content platform like Facebook worth the cost?
Everybody’s talking about how distributing content through third-party organizations such as Facebook or Twitter could hurt digital publishers, ...

Resources last updated: 12/5/2015 10:04:17 PM