ASP.NET 2.0 ProfessionalIf you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 2.0 Professional section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
I use Forms authentication in my project, I had no problems with it when my project was in 1.x, but since I moved it to 2.0 I am having trouble validating users in roles...they all come up as Authenticated, but false when I look at User.IsInRole("rolename")...is there a way to list out all the roles that a User is in?
-------------------------
Beware of programmers with screwdrivers...
__________________
-------------------------
Beware of programmers with screwdrivers...
Dim cookieName As String = FormsAuthentication.FormsCookieName
Dim authCookie As HttpCookie = Context.Request.Cookies(cookieName)
Dim authTicket As FormsAuthenticationTicket = Nothing
authTicket = FormsAuthentication.Decrypt(authCookie.Value)
Dim roles As String() = authTicket.UserData.Split(New Char() {"|"c})
For Each r As String In roles
Response.Write("arrayval=" & r & "<br />")
Next
-------------------------
Beware of programmers with screwdrivers...