This project is read-only.

Working with Membership

DbEntry 4.2 doesn't include Membership dll by mistake, download and upzip it into %DbEntryPath% will be OK.
  • Create new web site in vs2010, add a web.config and change it as following:
<?xml version="1.0"?>
    <section name="Leafing.Settings"
      type="Leafing.Util.Setting.NameValueSectionHandler, Leafing.Util" />
    <add key="AutoCreateTable" value="true" />
    <add key="DataBase" value="@SQLite : @~Test.db" />
    <add key="DbProviderFactory"
value="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
    <compilation debug="true"/>
    <membership defaultProvider="DbEntryMembershipProvider">
        <clear />
        <add name="DbEntryMembershipProvider" type="Leafing.Web.DbEntryMembershipProvider, Leafing.Web"/>
    <roleManager defaultProvider="DbEntryRole">
        <clear />
        <add name="DbEntryRole" type="Leafing.Web.DbEntryRoleProvider, Leafing.Web"/>
    <authentication mode="Forms">
      <forms name=".ADUAUTH" loginUrl="MyLogin.aspx" defaultUrl="Default.aspx" protection="All" />
      <deny users="?" />
      <allow users="*" />
  • Add the references of "Leafing.Util", "Leafing.Data" and "Leafing.Web"
  • Create a new page named "MyLogin.aspx"
  • Drag a CreateUserWizard control to MyLogin.aspx
  • Run this web site and create a user named "tom" and set the password as "123456"
  • Remove the CreateUserWizard control from MyLogin.aspx
  • Drag a Login control to MyLogin.aspx
  • Drag a LoginName control to Default.aspx
  • Run this web site and use "tom/123456" to login
  • Use SqlQuerier to check the "Test.db" in web folder, ensure the table already created, and the row of "tom" already created

Last edited Aug 27, 2014 at 7:47 AM by lifeng, version 11


No comments yet.