Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 9th, 2007, 02:15 PM
jamara
Guest
 
Posts: n/a
Default Membership Provider error

I am trying to write a Membership Provider but keep getting the error that the site "Could not load type 'OdbcMembershipProvider'".
I'd really appreciate it if someone could review this code and help me with this.


Here's an exerpt from my web.config file.

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <appSettings/>
    <connectionStrings>
        <add name="MyConnection" connectionString="Data Source=XYZ;User ID=******;Password=******;Unicode=False" providerName="System.Data.OracleClient"/>
    </connectionStrings>
  <system.web>
    <customErrors mode="Off"/>
    <roleManager enabled="true"/>
    <authentication mode="Forms">
      <forms name=".UIDCOOKIE"
       loginUrl="Login.aspx" />
    </authentication>
  </system.web>

  <location path="default.aspx" />

  <system.web>
    <authorization>
            <allow roles="Administrator"/>
            <allow roles="User"/>
            <allow roles="Clerk"/>
      <deny users="?" />
    </authorization>

    <membership defaultProvider="OdbcMembershipProvider" userIsOnlineTimeWindow="15">
      <providers>
        <add
        name="OdbcMembershipProvider"
        type="OdbcMembershipProvider"
        connectionStringName="MyConnection"
        enablePasswordRetrieval="false"
        enablePasswordReset="true"
        requiresQuestionAndAnswer="true"
        writeExceptionsToEventLog="true"
        applicationName="/"
        requiresUniqueEmail="true"
        passwordFormat="Hashed"
        maxInvalidPasswordAttempts="3"
        passwordAttemptWindow="15"
        passwordStrengthRegularExpression='@\"(?=.{6,})(?= (.*\d){1,})(?=(.*\W){1,})' />
    </providers>
  </membership>

  </system.web>
</configuration>


I have created a class file named 'OdbcMembershipProvider.vb' in my site. Here is the beginning of that file:

Imports System.Web.Security
Imports System.Configuration.Provider
Imports System.Collections.Specialized
Imports System
Imports System.Data
Imports System.Data.Odbc
Imports System.Configuration
Imports System.Diagnostics
Imports System.Web
Imports System.Globalization
Imports System.Security.Cryptography
Imports System.Text
Imports System.Web.Configuration

Namespace OdbcMembershipProvider


    Public Class OdbcMembershipProvider
        Inherits MembershipProvider
.
.
.


 
Old March 12th, 2007, 02:01 PM
jamara
Guest
 
Posts: n/a
Default

I think the issue here is that I created a website vs. a project. Does anyone have any information on the value of the type element in the membership provider for an .ASP website vs. a project? I don't think there is an assembly name in the properties of a website.

Is there a way to take the website created and move it into a project?
Is that the recommended approach?









Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Membership Provider Scott663 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 August 1st, 2008 05:16 PM
Help with membership Provider... slim182 ASP.NET 2.0 Basics 1 February 19th, 2007 10:15 AM
membership provider davyquyo ASP.NET 2.0 Basics 0 January 1st, 2007 04:52 AM
Membership Provider bmains ASP.NET 2.0 Basics 4 April 13th, 2006 04:10 PM
custom membership provider msrnivas General .NET 1 September 18th, 2005 04:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.