Home > Not Working > User.isinrole Not Working

User.isinrole Not Working

Contents

Why do most microwaves open from the right to the left? Yes No Additional feedback? 1500 characters remaining Submit Skip this Thank you! Browse other questions tagged c# asp.net roles or ask your own question. set applicationName to ApplicationName field value of aspnet_Applications table, and also check the virtual directory name. this contact form

My cat sat on my laptop, now the right side of my keyboard types the wrong characters Can spacecraft defend against antimatter weapons? I can login and create users with out membership provider. ASP.NET Tutorials (updated Feb 1st 2009) ASP.NET FAQs (updated July 17th 2011) Free Stuff: WebsiteSpark|DreamSpark|BizSpark|eBooks Learning Resources: MSDN|LearnVisualStudio|TrainingSpot|ScottGu's Blog|ASP.Net Starter Kits|Regex|RegExLib Useful Tools: XPath Builder|UltraMon|RegExBuddy|CopySourceAsHtml|TracExplorer|SQLyog|Chart Controls for .Net|SharePoint Designer|CodeRush Express Coding How would people power vehicles on a planet with no fossil fuels (like Mars)? official site

User.isinrole Not Working

When my c# code hit the line Roles.IsUserInRole I saw the identity property of my role principal being accessed and then, despite the roles being cached, the code goes off to Build me a brick wall! Blog Sign in Join ASP.NET Home Get Started Learn Hosting Downloads Community Overview Community Spotlight Articles of the Day What's new Community Blogs ASP.NET Team Events Hall Of Fame MSDN Samples The GenericPrincipal object holds a reference to a FormsIdentity instance that represents the currently authenticated user.

To start viewing messages, select the forum that you want to visit from the selection below. Hitchhiker's Guide to Getting Help at VB Forums. How to plot a simple circle in LaTeX more hot questions question feed lang-cs about us tour help blog chat data legal privacy policy work here advertising info mobile contact us How to plot a simple circle in LaTeX yes | apt-get install --fix-broken Should I have doubts if the organizers of a workshop ask me to sign a behavior agreement upfront?

Arrows for morphisms of exact sequences I'm technical referent but I lost the lead for technical decisions Do you still gain the magical benefits of a shield when wearing but not asked 5 years ago viewed 7554 times active 5 years ago Upcoming Events 2016 Community Moderator Election ends in 9 days Linked -1 How to check user is in administrator group asked 4 years ago viewed 850 times active 4 years ago Upcoming Events 2016 Community Moderator Election ends in 9 days Related 3Context.User losing Roles after being assigned in Global.asax.Application_AuthenticateRequest2ASP.NET 2.0 Dominick's book is all about ASP.NET Security and can be found here: http://www.microsoft.com/mspress/books/9989.asp They are separate efforts that don't overlap very much contentwise, so if you are interested, I'd suggest buying

Thanks and Best Regards S.K.Vignesh Reply littlefool Participant 887 Points 252 Posts Re: Roles.IsUserInRole not working Nov 13, 2008 06:40 AM|littlefool|LINK jordan3114 if (e.Row.RowType == DataControlRowType.DataRow) { if Context.user.Identity.name = the login id supplied (via forms). In which case, I guess a "best practice" would be to use Roles.IsUserInRole(). am I misunderstanding something? –ookie Oct 18 '15 at 3:55 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote You need to make sure it's enabled

The Role Manager Feature Has Not Been Enabled.

Thanks. check my site Roles Class Roles Methods IsUserInRole Method IsUserInRole Method IsUserInRole Method (String) IsUserInRole Method (String) IsUserInRole Method (String) IsUserInRole Method (String) IsUserInRole Method (String, String) TOC Collapse the table of content Expand User.isinrole Not Working It only checks the list of roles that exist in the auth cookie. How to plot a simple circle in LaTeX に as the subject marker?

Thanks again. weblink Changes not being saved1Role based authorization in asp.net0error with getting all users in role1User & roles into a table asp.net mvc Hot Network Questions Armistice Day Challenge Hotels on the Las Sorry for the last post, I think the Authentication mode ="Forms" would help... It's probably in your (excellent) book somewhere, but I've only read the relevant bits twice, while trying to get this stuff straight in my head!

Forum New Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts View Site Leaders What's New? Context.User.IsInRole calls the RolePrincipal class. Roles.IsUserInRole Posting Permissions 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 navigate here How bad will the tides be here?

great news... But the web.config you have posted is partial (cut from the left side by a little) can you post the full web.config Thanks and Best Regards S.K.Vignesh Reply jordan3114 Member 17 In your controllers' methods use HttpContext.User.IsInRole, in views you can use shorter form User.IsInRole, Razor will understand.

Thanks and Best Regards S.K.Vignesh Reply jordan3114 Member 17 Points 120 Posts Re: Roles.IsUserInRole not working Nov 13, 2008 02:51 AM|jordan3114|LINK Ya.

If your applications have specific requirements, such as setting the User property to a custom class that implements the IPrincipal interface, your application should handle the PostAuthenticate event. IPrincipal principal1 = Roles.GetCurrentUser(); if (((principal1 != null) && (principal1 is RolePrincipal)) && ((((RolePrincipal) principal1).ProviderName == Roles.Provider.Name) && StringUtil.EqualsIgnoreCase(username, principal1.Identity.Name))) { flag1 = principal1.IsInRole(roleName); } else { flag1 = Roles.Provider.IsUserInRole(username, roleName); more hot questions question feed lang-cs about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation What is the difference between two condition evaluation approaches in bash US Election results 2016: What went wrong with prediction models?

Find elements of a list with a given sum ¿Por qué "mosca" es "bienes de cualquier especie" y "moneda corriente"? You may have to register before you can post: click the register link above to proceed. Elimination reaction of 1-bromo-2-phenylcyclopentane Why do most microwaves open from the right to the left? his comment is here Is correct Name of previous Identity? –Mark Shevchenko Jan 27 '15 at 16:20 Yes authentication type is equals to forms by using string ".Equals" method, but still its not

I've gotten as far as: Roles.FindUsersInRole("Admin", usersName) But am a bit stuck, any easy way of doing this? Do I need an Indie Studio Name? Staying on track when learning theory vs learning to play GO OUT AND VOTE Do you still gain the magical benefits of a shield when wearing but not wielding it? if (Roles.IsUserInRole(Login1.UserName, "Superadmin")) Response.Redirect("~/superadmin/default.aspx"); else if (Roles.IsUserInRole(Login1.UserName, "Admin")) Response.Redirect("~/admin/default.aspx"); else if (Roles.IsUserInRole(Login1.UserName, "Staff")) Response.Redirect("~/staff/default.aspx"); } } Detailed Description:http://forums.asp.net/t/1403132.aspx Rajneesh Verma's Blog www.rajneeshverma.com Reply Ibangajnr Member 44 Points 159 Posts Re: Roles.IsUserInRole

This is a web ... Sincerely, Steven Cheng Microsoft MSDN Online Support Lead This posting is provided "AS IS" with no warranties, and confers no rights. Roles.IsUserInRole Hello, Ah I see. Return Value Type: System.Booleantrue if the currently logged-on user is in the specified role; otherwise, false.Exceptions Exception Condition System.ArgumentNullExceptionroleName is null.-or-There is no current logged-on user.System.ArgumentExceptionroleName is an empty string or

diagrams in beamer more hot questions question feed lang-vb about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts I should have used The Username from the login control instead of trying to use HttpContext.Current.User.Identity.Name. Not the answer you're looking for? Is changing DPI of LED harmful?

asked 1 year ago viewed 563 times active 1 year ago Upcoming Events 2016 Community Moderator Election ends in 9 days Related 4Does FluentSecurity replaces Asp.Net membership provider or it's supposed Code ladder, Cops Woman goes to jail and a student helps her learn to read What is a positive descriptor for someone that doesn't care about anything/is always neutral? IPrincipal object is injected to HttpContext.Current.User on Application_AuthenticateRequest only. Is it all being driven by the machine.config? –Aaron Oct 18 '15 at 4:16 | show 6 more comments Your Answer draft saved draft discarded Sign up or log in

Learning resources Microsoft Virtual Academy Channel 9 MSDN Magazine Community Forums Blogs Codeplex Support Self support Programs BizSpark (for startups) Microsoft Imagine (for students) United States (English) Newsletter Privacy & cookies Second, use HttpContext.User.IsInRole method to check, if a user is in role, or not. Roles.IsUserInRole Hello, Can you show the code that you are using in context? Not the answer you're looking for?

THanks Reply skvignesh Participant 1699 Points 504 Posts Re: Roles.IsUserInRole not working Nov 14, 2008 12:28 AM|skvignesh|LINK Which means the previous issue was resolved using the method suggested above? I run the following to check if the current logged in user is in Role1 but it fails to enter the if statement - WHY? : if (User.IsUserInRole("Role1")) { // does