Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Login control and redirect depends on ROLE

Posted on 2006-04-25
4
Medium Priority
?
289 Views
Last Modified: 2008-02-01
Hi experts

How can i redirect user depends on role he belong?

        If (Membership.ValidateUser(Login1.UserName, Login1.Password)) Then
            Dim r() As String = Roles.GetRolesForUser(Login1.UserName)
            For i As Byte = 0 To r.Length
                Select Case r(i).ToUpper
                    Case "ABC"
                         response.redirect...
                    Case "DEF"
                         response.redirect...
                    Case "GHI"
                    Case "JKL"
                End Select
            Next
        End If

the code works but i cannot redirect the user, it's like web.config is missing something :

  <authentication mode="Forms">
   <forms name=".COOK" />
  </authentication>
  <sessionState mode="InProc" cookieless="false" timeout="30"></sessionState>  
            <roleManager enabled="true">
   <providers>
    <remove name="AspNetSqlRoleProvider" />
    <add connectionStringName="SMS_ManConnectionString" applicationName="/"
     name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   </providers>
  </roleManager>
            <membership>
   <providers>
    <remove name="AspNetSqlMembershipProvider" />
    <add connectionStringName="SMS_ManConnectionString" enablePasswordRetrieval="true"
     enablePasswordReset="true" requiresQuestionAndAnswer="false"
     applicationName="/" requiresUniqueEmail="true" passwordFormat="Encrypted"
     maxInvalidPasswordAttempts="5" minRequiredPasswordLength="1"
     minRequiredNonalphanumericCharacters="0" name="AspNetSqlMembershipProvider"
     type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   </providers>
  </membership>
0
Comment
Question by:Dnx_7
  • 2
4 Comments
 
LVL 9

Expert Comment

by:daniel_balla
ID: 16533454
what exactly does it do (or does it not do) ?
0
 
LVL 10

Accepted Solution

by:
SystemExpert earned 1500 total points
ID: 16533456
Hi,

You should use role based authentication. see the following link

http://www.codeproject.com/aspnet/rolesbasedauthentication.asp

Thanks
0
 
LVL 2

Author Comment

by:Dnx_7
ID: 16533531
daniel balla :

in fact the validation of user/pwd is correct, but i cannot redirect user to any page
it's like there is something wrong in the web.config file

systemExpert :
that is what i'm trying to do but i get some errors
0
 
LVL 2

Author Comment

by:Dnx_7
ID: 16533587
ok i found the problem
it was an error in the web.config file :)

regards
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question