forked from MVCAppDesignAndDevelop/MVC5Book
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASP.NET MVC 5 網站開發美學 - 第12章使用 Membership 驗證範例程式碼
- Loading branch information
demofan
committed
Aug 29, 2014
1 parent
e1b793f
commit e975a33
Showing
45 changed files
with
27,228 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2013 | ||
VisualStudioVersion = 12.0.30501.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MembershipSample", "MembershipSample\MembershipSample.csproj", "{DD1751C7-2F3F-4D63-9260-6901E523969D}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{DD1751C7-2F3F-4D63-9260-6901E523969D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DD1751C7-2F3F-4D63-9260-6901E523969D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{DD1751C7-2F3F-4D63-9260-6901E523969D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{DD1751C7-2F3F-4D63-9260-6901E523969D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
35 changes: 35 additions & 0 deletions
35
Ch12-MembershipSample/MembershipSample/App_Start/BundleConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Web; | ||
using System.Web.Optimization; | ||
|
||
namespace MembershipSample | ||
{ | ||
public class BundleConfig | ||
{ | ||
// 如需「搭配」的詳細資訊,請瀏覽 http://go.microsoft.com/fwlink/?LinkId=301862 | ||
public static void RegisterBundles(BundleCollection bundles) | ||
{ | ||
bundles.Add(new ScriptBundle("~/bundles/jquery").Include( | ||
"~/Scripts/jquery-{version}.js")); | ||
|
||
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( | ||
"~/Scripts/jquery.validate*")); | ||
|
||
// 使用開發版本的 Modernizr 進行開發並學習。然後,當您 | ||
// 準備好實際執行時,請使用 http://modernizr.com 上的建置工具,只選擇您需要的測試。 | ||
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( | ||
"~/Scripts/modernizr-*")); | ||
|
||
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( | ||
"~/Scripts/bootstrap.js", | ||
"~/Scripts/respond.js")); | ||
|
||
bundles.Add(new StyleBundle("~/Content/css").Include( | ||
"~/Content/bootstrap.css", | ||
"~/Content/site.css")); | ||
|
||
// 將 EnableOptimizations 設為 false 以進行偵錯。如需詳細資訊, | ||
// 請造訪 http://go.microsoft.com/fwlink/?LinkId=301862 | ||
BundleTable.EnableOptimizations = true; | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Ch12-MembershipSample/MembershipSample/App_Start/FilterConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Web; | ||
using System.Web.Mvc; | ||
|
||
namespace MembershipSample | ||
{ | ||
public class FilterConfig | ||
{ | ||
public static void RegisterGlobalFilters(GlobalFilterCollection filters) | ||
{ | ||
filters.Add(new HandleErrorAttribute()); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
Ch12-MembershipSample/MembershipSample/App_Start/RouteConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Mvc; | ||
using System.Web.Routing; | ||
|
||
namespace MembershipSample | ||
{ | ||
public class RouteConfig | ||
{ | ||
public static void RegisterRoutes(RouteCollection routes) | ||
{ | ||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | ||
|
||
routes.MapRoute( | ||
name: "Default", | ||
url: "{controller}/{action}/{id}", | ||
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
body { | ||
padding-top: 50px; | ||
padding-bottom: 20px; | ||
} | ||
|
||
/* Set padding to keep content from hitting the edges */ | ||
.body-content { | ||
padding-left: 15px; | ||
padding-right: 15px; | ||
} | ||
|
||
/* Set width on the form input elements since they're 100% wide by default */ | ||
input, | ||
select, | ||
textarea { | ||
max-width: 280px; | ||
} |
Oops, something went wrong.