Shining Star Services LLC

Creating a Custom Membership Provider and Membership User utilizing a Data Set Table Adapter - Step 18

by Nannette Thacker

Our Default Page

Our Default page displays a grid of all users, with limited columns from the table.



<%@ Page Language="VB" MasterPageFile="~/SSS.master" 
AutoEventWireup="false"
    CodeFile="Default.aspx.vb" Inherits="_Default" 
    Title="Nannette Thacker's Custom Membership Provider Application" %>
<%@ MasterType VirtualPath="~/SSS.Master" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
    runat="Server">
    <div>
    Custom Membership Provider
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CellPadding="0" DataKeyNames="userID" DataSourceID="SqlDataSource1" 
            ForeColor="#333333" GridLines="None" Width="500">
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="userID" HeaderText="userID" 
                InsertVisible="False" 
                    ReadOnly="True" SortExpression="userID" />
                <asp:BoundField DataField="username" HeaderText="username" 
                    SortExpression="username" />
                <asp:BoundField DataField="userpassword" HeaderText="userpassword" 
                    SortExpression="userpassword" />
                <asp:BoundField DataField="useremail" HeaderText="useremail" 
                    SortExpression="useremail" />
            </Columns>
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SSNetConnectionString %>" 
            SelectCommand="SELECT [userID], [username], [userpassword], [useremail] FROM [Users]">
        </asp:SqlDataSource>
        
       
    </div>
</asp:Content>

All processing is handled in the code in front, so there is really nothing much in the code behind.

This concludes our series on creating your own custom membership provider using datasets and table adapters. Although I wasn't prolific in my explanations, I hope being able to view the code helped you in some way.

Steps for Creating a Custom Membership Provider and Membership User utilizing a DataSet Table Adapter:

Introduction: Creating a Custom Membership Provider and Membership User utilizing a DataSet Table Adapter.
Step 1: Creating the Project and Folders.
Step 2: Table Data Structure and Web.config for this Tutorial.
Step 3: Creating The DataSet.
Step 4: Creating the Table Adapter Methods for GetUserByLogin, GetUserByUserName, and InsertUser.
Step 5: Creating our Custom MembershipProvider Class.
Step 6: Adding Properties to Our Custom MembershipProvider Class.
Step 7: Creating Our Custom MembershipUser Class.
Step 8: Customizing our MembershipProvider Class.
Step 9: Our Custom RoleProvider Class.
Step 10: Our Master page.
Step 11: Our Cookie Handler class.
Step 12: Our Log In page.
Step 13: Our Register page.
Step 14: Our Log Out page.
Step 15: Our Change Password page.
Step 16: Our Administration page.
Step 17: Loading a Menu Programmatically based on Roles.
Step 18: Our Default page.
Download the ZIP files:
VB: ShiningStarCustomMemberProviderTutorial.zip
© Copyright 1997-2017 Shining Star Services LLC, Nannette Thacker. All Rights Reserved.