Click here to Skip to main content
14,272,438 members
Articles » Web Development » ASP.NET » General » Downloads

Custom Membership Providers

Rate this:
4.78 (69 votes)
Please Sign up or sign in to vote.
4.78 (69 votes)
18 Oct 2013CPOL
This article concentrates on implementing forms authentication for an ASP.NET MVC application.
Custom-Membership-Providers-Using_Entity-Framework
.gitignore
CustomMembershipEF
Content
Contexts
Controllers
Entities
Infrastructure
Interfaces
Models
Properties
Scripts
Services
Views
Account
Home
Shared
packages
EntityFramework.4.1.10331.0
EntityFramework.4.1.10331.0.nupkg
lib
jQuery.1.8.3
Content
Scripts
jQuery.1.8.3.nupkg
Tools
jQuery.Validation.1.10.0
Content
Scripts
jQuery.Validation.1.10.0.nupkg
.gitignore
EntityFramework.4.1.10331.0.nupkg
EntityFramework.dll
jQuery.1.8.3.nupkg
jQuery.Validation.1.10.0.nupkg
CustomMembership
CustomMembership
App_Data
bin
CustomMembership.dll
CustomMembership.pdb
Content
Controllers
CustomMembership.csproj.user
Models
Properties
Scripts
Views
Account
Home
Shared
Site.Master
CustomMembership.suo
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using CustomMembershipEF.Contexts;

namespace CustomMembershipEF
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());
        }

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            Database.SetInitializer<UsersContext>(null);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Karthik. A
Software Developer (Senior)
United States United States
Just another passionate software developer!

Some of the contributions to the open source world - a blog engine written in MVC 4 - sBlog.Net. Check it out here. For the codeproject article regarding sBlog.Net click here!

(Figuring out this section!)

Stats

412.4K views
19.2K downloads
222 bookmarked