Problem on using Custom Role Provider

Last post 03-05-2007 6:02 AM by aghausman12. 2 replies.

Sort Posts:

  • Problem on using Custom Role Provider

    03-05-2007, 1:10 AM
    • Member
      280 point Member
    • adsmag
    • Member since 11-13-2006, 9:11 AM
    • Posts 85

    I've already searched the forum regarding this but I can't get an answer in VB code and exact details.. I've already get the idea on how to create the custom membership provider but I can't understand the how to use a custom role provider.

    I've already put the ff codes on my web.config

    <roleManager enabled="true" defaultProvider="Class2">
            <providers>
              <add name="Class2"
              connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Inetpub\wwwroot\NewProvider\App_Data\User.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
              applicationName="/"   type="Class2"/>
            </providers>
          </roleManager>
            <membership defaultProvider="Class1"
              cookieName=".ASPROLES"
              cookieTimeout="30"
              cookiePath="/"
              cookieRequireSSL="false"
              cookieSlidingExpiration="true"
              cookieProtection="All">
              <providers>
                <add requiresQuestionAndAnswer="False" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Inetpub\wwwroot\NewProvider\App_Data\User.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
                  applicationName="/"   name="Class1" type="Class1" />
              </providers>
            </membership>

     

    Ive also created a Class in App_code folder and inherits the RoleProvider.. the problem is, i dont know what and how to overwrite the important function on the Class. Please help me on how to implement this custom role provider. thanks. any example in VB can help.
     

    I don't know .NET! Why I'm here???
  • Re: Problem on using Custom Role Provider

    03-05-2007, 6:01 AM
    • Contributor
      3,035 point Contributor
    • aghausman12
    • Member since 02-19-2007, 7:55 AM
    • Karachi, Pakistan
    • Posts 550
    just import the following class  and all your required method will appear as soon as you type overrides
    Public Class Modif
        Inherits SqlRoleProvider
    
    
    
    
    
    End Class

     

    cheers 

    Dont forget to click "Mark as Answer" on the post that helped you. This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
    http://www.aghausman.net
  • Re: Problem on using Custom Role Provider

    03-05-2007, 6:02 AM
    Answer
    • Contributor
      3,035 point Contributor
    • aghausman12
    • Member since 02-19-2007, 7:55 AM
    • Karachi, Pakistan
    • Posts 550
    just import the following class  and all your required method will appear as soon as you type overrides
    Public Class Modif
        Inherits SqlRoleProvider
    
    
    
    
    
    End Class

    example : http://www.devx.com/asp/Article/29256/0/page/3 

    cheers

    Dont forget to click "Mark as Answer" on the post that helped you. This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
    http://www.aghausman.net
Page 1 of 1 (3 items)