Login control and redirect depends on ROLE

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>
LVL 2
Dnx_7Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

daniel_ballaCommented:
what exactly does it do (or does it not do) ?
0
SystemExpertCommented:
Hi,

You should use role based authentication. see the following link

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

Thanks
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dnx_7Author Commented:
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
Dnx_7Author Commented:
ok i found the problem
it was an error in the web.config file :)

regards
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.