473,322 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

role based Authentication

Hi friends,
I have done role based authentication, now has two roles ,Admin and User.
using location tag in web.cofig.
FormAuthentication.DirectfromLoginpage is working fine.
But I am not able to redirect to Admin page after login as Admin
using

if(User.IsInRole("Admin")==true)
{
Response.Redirect("Admin.aspx");
}
else
{
errMessage.Text="You are not Authorised";
}
I wrote this code in Login page but the code not working properly.
not Redirecting with each request. and err message not getting print.
Can any one help.
Also I am getting Thread abortion Exception

I havent used any login controls .So I have written the code in the sign in click event itself. So I think that the role of the current user is not getting .
Is it like that ?Is there any solution for this
Feb 12 '07 #1
3 1251
hi,
could u plz explain me what is User.IsInRole("Admin")==true means
Feb 12 '07 #2
hi,
could u plz explain me what is User.IsInRole("Admin")==true means
After logged in we can chech in which role the user has logged in using User.IsInRole
thats what i tried but it is not working in the loggin page.
Any other alternative.
Feb 12 '07 #3
hi,
i think u mean the same as it is in
http://www.thescripts.com/forum/thread600725.html
hope that helps u,
Feb 12 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: hazz | last post by:
If I successfully run a VS.NET app which includes the following; ************************** APP 1 **************************** m_iIdnt = new...
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
1
by: Mike Logan | last post by:
Questions about Role Based Security in ASP.Net: I have a few questions about role based security in an ASP.Net application. Below are some points about our system: - We have a hierarchical...
5
by: Archer | last post by:
I was making a role-based authentication but it does't login with correct password. the HttpContext.Current.User recieved in Global.asax is always null. Request.IsAuthenticated is always false....
1
by: Hennie | last post by:
Ho can I get the role of the user in a ASP.net 2.0 web application? I am using AspNetSqlProvider to manage my membership. I can get the user by using User.Identity.Name. What will the command be to...
5
by: Jon Skeet [C# MVP] | last post by:
I've got a web service where different methods require different roles, and I'm trying to enforce that now. I've worked out *one* way of doing things, using PrincipalPermissionAttribute - but...
7
by: nugget | last post by:
Role-based security for an ASP/ASP.NET mixed environment Hello: My co-worker and I have been charged with designing role-based security for our intranet. The technologies we have to work with...
6
by: Max2006 | last post by:
Hi, I need to hide a series of siteMapNodes to certain roles. That means roles have access to the siteMapNode, but the node doesn't appear on the navigation menu. I'll use Response.Redirect to...
3
by: RedHair | last post by:
I use the Form Authentication and Role base security to secure one ASP.NET 3.5 appication. Below are security settings in web.config <location path="testAdmin.aspx"> <system.web>...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.