├── .gitignore ├── BootstrapMVC.csproj ├── BootstrapMVC.csproj.user ├── BootstrapMVC.sln ├── Content ├── bootstrap.css └── themes │ └── base │ ├── images │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ ├── ui-bg_flat_75_ffffff_40x100.png │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ ├── ui-bg_glass_65_ffffff_1x400.png │ ├── ui-bg_glass_75_dadada_1x400.png │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ ├── ui-bg_glass_95_fef1ec_1x400.png │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ ├── ui-icons_222222_256x240.png │ ├── ui-icons_2e83ff_256x240.png │ ├── ui-icons_454545_256x240.png │ ├── ui-icons_888888_256x240.png │ └── ui-icons_cd0a0a_256x240.png │ ├── jquery.ui.accordion.css │ ├── jquery.ui.all.css │ ├── jquery.ui.autocomplete.css │ ├── jquery.ui.base.css │ ├── jquery.ui.button.css │ ├── jquery.ui.core.css │ ├── jquery.ui.datepicker.css │ ├── jquery.ui.dialog.css │ ├── jquery.ui.progressbar.css │ ├── jquery.ui.resizable.css │ ├── jquery.ui.selectable.css │ ├── jquery.ui.slider.css │ ├── jquery.ui.tabs.css │ └── jquery.ui.theme.css ├── Controllers ├── AccountController.cs └── HomeController.cs ├── Global.asax ├── Global.asax.cs ├── Models └── AccountModels.cs ├── Properties └── AssemblyInfo.cs ├── README.md ├── Scripts ├── MicrosoftAjax.debug.js ├── MicrosoftAjax.js ├── MicrosoftMvcAjax.debug.js ├── MicrosoftMvcAjax.js ├── MicrosoftMvcValidation.debug.js ├── MicrosoftMvcValidation.js ├── jquery-1.5.1-vsdoc.js ├── jquery-1.5.1.js ├── jquery-1.5.1.min.js ├── jquery-ui-1.8.11.js ├── jquery-ui-1.8.11.min.js ├── jquery.unobtrusive-ajax.js ├── jquery.unobtrusive-ajax.min.js ├── jquery.validate-vsdoc.js ├── jquery.validate.js ├── jquery.validate.min.js ├── jquery.validate.unobtrusive.js ├── jquery.validate.unobtrusive.min.js ├── modernizr-1.7.js └── modernizr-1.7.min.js ├── Views ├── Account │ ├── ChangePassword.cshtml │ ├── ChangePasswordSuccess.cshtml │ ├── LogOn.cshtml │ └── Register.cshtml ├── Home │ ├── About.cshtml │ └── Index.cshtml ├── Shared │ ├── Error.cshtml │ ├── _Layout.cshtml │ └── _LogOnPartial.cshtml ├── Web.config └── _ViewStart.cshtml ├── Web.Debug.config ├── Web.Release.config ├── Web.config └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | #ignore thumbnails created by windows 3 | Thumbs.db 4 | #Ignore files build by Visual Studio 5 | *.obj 6 | *.exe 7 | *.pdb 8 | *.user 9 | *.aps 10 | *.pch 11 | *.vspscc 12 | *_i.c 13 | *_p.c 14 | *.ncb 15 | *.suo 16 | *.tlb 17 | *.tlh 18 | *.bak 19 | *.cache 20 | *.ilk 21 | *.log 22 | [Bb]in 23 | [Dd]ebug*/ 24 | *.lib 25 | *.sbr 26 | obj/ 27 | [Rr]elease*/ 28 | _ReSharper*/ 29 | [Tt]est[Rr]esult* -------------------------------------------------------------------------------- /BootstrapMVC.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 7 | 8 | 2.0 9 | {D1D831F8-FA7C-4AFD-98D3-4FE3160A3E18} 10 | {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 11 | Library 12 | Properties 13 | BootstrapMVC 14 | BootstrapMVC 15 | v4.0 16 | false 17 | false 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | pdbonly 30 | true 31 | bin\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\packages\EntityFramework.4.1.10331.0\lib\EntityFramework.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Global.asax 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | Web.config 116 | 117 | 118 | Web.config 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | False 164 | True 165 | 2089 166 | / 167 | 168 | 169 | False 170 | False 171 | 172 | 173 | False 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /BootstrapMVC.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | SpecificPage 13 | True 14 | False 15 | False 16 | False 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | False 26 | True 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /BootstrapMVC.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapMVC", "BootstrapMVC.csproj", "{D1D831F8-FA7C-4AFD-98D3-4FE3160A3E18}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {D1D831F8-FA7C-4AFD-98D3-4FE3160A3E18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {D1D831F8-FA7C-4AFD-98D3-4FE3160A3E18}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {D1D831F8-FA7C-4AFD-98D3-4FE3160A3E18}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {D1D831F8-FA7C-4AFD-98D3-4FE3160A3E18}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /Content/themes/base/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyurisc/BootstrapMVC/d67483e856f3b1bf9ebf967112acefe195dee171/Content/themes/base/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.accordion.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Accordion 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Accordion#theming 14 | */ 15 | /* IE/Win - Fix animation bug - #4615 */ 16 | .ui-accordion { width: 100%; } 17 | .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } 18 | .ui-accordion .ui-accordion-li-fix { display: inline; } 19 | .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } 20 | .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } 21 | .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } 22 | .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } 23 | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } 24 | .ui-accordion .ui-accordion-content-active { display: block; } 25 | -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.all.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI CSS Framework 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Theming 14 | */ 15 | @import "jquery.ui.base.css"; 16 | @import "jquery.ui.theme.css"; 17 | -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.autocomplete.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Autocomplete 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * http://docs.jquery.com/UI/Autocomplete#theming 13 | */ 14 | .ui-autocomplete { position: absolute; cursor: default; } 15 | 16 | /* workarounds */ 17 | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ 18 | 19 | /* 20 | * Note: While Microsoft is not the author of this file, Microsoft is 21 | * offering you a license subject to the terms of the Microsoft Software 22 | * License Terms for Microsoft ASP.NET Model View Controller 3. 23 | * Microsoft reserves all other rights. The notices below are provided 24 | * for informational purposes only and are not the license terms under 25 | * which Microsoft distributed this file. 26 | * 27 | * jQuery UI Menu 1.8.11 28 | * 29 | * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) 30 | * 31 | * http://docs.jquery.com/UI/Menu#theming 32 | */ 33 | .ui-menu { 34 | list-style:none; 35 | padding: 2px; 36 | margin: 0; 37 | display:block; 38 | float: left; 39 | } 40 | .ui-menu .ui-menu { 41 | margin-top: -3px; 42 | } 43 | .ui-menu .ui-menu-item { 44 | margin:0; 45 | padding: 0; 46 | zoom: 1; 47 | float: left; 48 | clear: left; 49 | width: 100%; 50 | } 51 | .ui-menu .ui-menu-item a { 52 | text-decoration:none; 53 | display:block; 54 | padding:.2em .4em; 55 | line-height:1.5; 56 | zoom:1; 57 | } 58 | .ui-menu .ui-menu-item a.ui-state-hover, 59 | .ui-menu .ui-menu-item a.ui-state-active { 60 | font-weight: normal; 61 | margin: -1px; 62 | } 63 | -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.base.css: -------------------------------------------------------------------------------- 1 | @import url("jquery.ui.core.css"); 2 | @import url("jquery.ui.resizable.css"); 3 | @import url("jquery.ui.selectable.css"); 4 | @import url("jquery.ui.accordion.css"); 5 | @import url("jquery.ui.autocomplete.css"); 6 | @import url("jquery.ui.button.css"); 7 | @import url("jquery.ui.dialog.css"); 8 | @import url("jquery.ui.slider.css"); 9 | @import url("jquery.ui.tabs.css"); 10 | @import url("jquery.ui.datepicker.css"); 11 | @import url("jquery.ui.progressbar.css"); -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.button.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Button 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Button#theming 14 | */ 15 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ 16 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ 17 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ 18 | .ui-button-icons-only { width: 3.4em; } 19 | button.ui-button-icons-only { width: 3.7em; } 20 | 21 | /*button text element */ 22 | .ui-button .ui-button-text { display: block; line-height: 1.4; } 23 | .ui-button-text-only .ui-button-text { padding: .4em 1em; } 24 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } 25 | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } 26 | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } 27 | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } 28 | /* no icon support for input elements, provide padding by default */ 29 | input.ui-button { padding: .4em 1em; } 30 | 31 | /*button icon element(s) */ 32 | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } 33 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } 34 | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } 35 | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 36 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 37 | 38 | /*button sets*/ 39 | .ui-buttonset { margin-right: 7px; } 40 | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } 41 | 42 | /* workarounds */ 43 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ 44 | -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.core.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI CSS Framework 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Theming/API 14 | */ 15 | 16 | /* Layout helpers 17 | ----------------------------------*/ 18 | .ui-helper-hidden { display: none; } 19 | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } 20 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 21 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 22 | .ui-helper-clearfix { display: inline-block; } 23 | /* required comment for clearfix to work in Opera \*/ 24 | * html .ui-helper-clearfix { height:1%; } 25 | .ui-helper-clearfix { display:block; } 26 | /* end clearfix */ 27 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 28 | 29 | 30 | /* Interaction Cues 31 | ----------------------------------*/ 32 | .ui-state-disabled { cursor: default !important; } 33 | 34 | 35 | /* Icons 36 | ----------------------------------*/ 37 | 38 | /* states and images */ 39 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 40 | 41 | 42 | /* Misc visuals 43 | ----------------------------------*/ 44 | 45 | /* Overlays */ 46 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } 47 | -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.datepicker.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Datepicker 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Datepicker#theming 14 | */ 15 | .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } 16 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } 17 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } 18 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } 19 | .ui-datepicker .ui-datepicker-prev { left:2px; } 20 | .ui-datepicker .ui-datepicker-next { right:2px; } 21 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } 22 | .ui-datepicker .ui-datepicker-next-hover { right:1px; } 23 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } 24 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } 25 | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } 26 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} 27 | .ui-datepicker select.ui-datepicker-month, 28 | .ui-datepicker select.ui-datepicker-year { width: 49%;} 29 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } 30 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } 31 | .ui-datepicker td { border: 0; padding: 1px; } 32 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } 33 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } 34 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } 35 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } 36 | 37 | /* with multiple calendars */ 38 | .ui-datepicker.ui-datepicker-multi { width:auto; } 39 | .ui-datepicker-multi .ui-datepicker-group { float:left; } 40 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } 41 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } 42 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } 43 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } 44 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } 45 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } 46 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } 47 | .ui-datepicker-row-break { clear:both; width:100%; } 48 | 49 | /* RTL support */ 50 | .ui-datepicker-rtl { direction: rtl; } 51 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } 52 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } 53 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } 54 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } 55 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } 56 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } 57 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } 58 | .ui-datepicker-rtl .ui-datepicker-group { float:right; } 59 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 60 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 61 | 62 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ 63 | .ui-datepicker-cover { 64 | display: none; /*sorry for IE5*/ 65 | display/**/: block; /*sorry for IE5*/ 66 | position: absolute; /*must have*/ 67 | z-index: -1; /*must have*/ 68 | filter: mask(); /*must have*/ 69 | top: -4px; /*must have*/ 70 | left: -4px; /*must have*/ 71 | width: 200px; /*must have*/ 72 | height: 200px; /*must have*/ 73 | } -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.dialog.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Dialog 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Dialog#theming 14 | */ 15 | .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } 16 | .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } 17 | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } 18 | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } 19 | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } 20 | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } 21 | .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } 22 | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } 23 | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } 24 | .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } 25 | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } 26 | .ui-draggable .ui-dialog-titlebar { cursor: move; } 27 | -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.progressbar.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Progressbar 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Progressbar#theming 14 | */ 15 | .ui-progressbar { height:2em; text-align: left; } 16 | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.resizable.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Resizable 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)] 12 | * 13 | * http://docs.jquery.com/UI/Resizable#theming 14 | */ 15 | .ui-resizable { position: relative;} 16 | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} 17 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } 18 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } 19 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } 20 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } 21 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } 22 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } 23 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } 24 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } 25 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.selectable.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Selectable 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Selectable#theming 14 | */ 15 | .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } 16 | -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.slider.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Slider 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Slider#theming 14 | */ 15 | .ui-slider { position: relative; text-align: left; } 16 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } 17 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } 18 | 19 | .ui-slider-horizontal { height: .8em; } 20 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } 21 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } 22 | .ui-slider-horizontal .ui-slider-range-min { left: 0; } 23 | .ui-slider-horizontal .ui-slider-range-max { right: 0; } 24 | 25 | .ui-slider-vertical { width: .8em; height: 100px; } 26 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } 27 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } 28 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; } 29 | .ui-slider-vertical .ui-slider-range-max { top: 0; } -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.tabs.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Tabs 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Tabs#theming 14 | */ 15 | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ 16 | .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } 17 | .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } 18 | .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } 19 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } 20 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } 21 | .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ 22 | .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } 23 | .ui-tabs .ui-tabs-hide { display: none !important; } 24 | -------------------------------------------------------------------------------- /Content/themes/base/jquery.ui.theme.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI CSS Framework 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Theming/API 14 | * 15 | * To view and modify this theme, visit http://jqueryui.com/themeroller/ 16 | */ 17 | 18 | 19 | /* Component containers 20 | ----------------------------------*/ 21 | .ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; } 22 | .ui-widget .ui-widget { font-size: 1em; } 23 | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; } 24 | .ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; } 25 | .ui-widget-content a { color: #222222/*{fcContent}*/; } 26 | .ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; } 27 | .ui-widget-header a { color: #222222/*{fcHeader}*/; } 28 | 29 | /* Interaction states 30 | ----------------------------------*/ 31 | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; } 32 | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; } 33 | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; } 34 | .ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; } 35 | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; } 36 | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; } 37 | .ui-widget :active { outline: none; } 38 | 39 | /* Interaction Cues 40 | ----------------------------------*/ 41 | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; } 42 | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; } 43 | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; } 44 | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; } 45 | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; } 46 | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } 47 | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } 48 | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } 49 | 50 | /* Icons 51 | ----------------------------------*/ 52 | 53 | /* states and images */ 54 | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } 55 | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } 56 | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; } 57 | .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; } 58 | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; } 59 | .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; } 60 | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; } 61 | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; } 62 | 63 | /* positioning */ 64 | .ui-icon-carat-1-n { background-position: 0 0; } 65 | .ui-icon-carat-1-ne { background-position: -16px 0; } 66 | .ui-icon-carat-1-e { background-position: -32px 0; } 67 | .ui-icon-carat-1-se { background-position: -48px 0; } 68 | .ui-icon-carat-1-s { background-position: -64px 0; } 69 | .ui-icon-carat-1-sw { background-position: -80px 0; } 70 | .ui-icon-carat-1-w { background-position: -96px 0; } 71 | .ui-icon-carat-1-nw { background-position: -112px 0; } 72 | .ui-icon-carat-2-n-s { background-position: -128px 0; } 73 | .ui-icon-carat-2-e-w { background-position: -144px 0; } 74 | .ui-icon-triangle-1-n { background-position: 0 -16px; } 75 | .ui-icon-triangle-1-ne { background-position: -16px -16px; } 76 | .ui-icon-triangle-1-e { background-position: -32px -16px; } 77 | .ui-icon-triangle-1-se { background-position: -48px -16px; } 78 | .ui-icon-triangle-1-s { background-position: -64px -16px; } 79 | .ui-icon-triangle-1-sw { background-position: -80px -16px; } 80 | .ui-icon-triangle-1-w { background-position: -96px -16px; } 81 | .ui-icon-triangle-1-nw { background-position: -112px -16px; } 82 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } 83 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } 84 | .ui-icon-arrow-1-n { background-position: 0 -32px; } 85 | .ui-icon-arrow-1-ne { background-position: -16px -32px; } 86 | .ui-icon-arrow-1-e { background-position: -32px -32px; } 87 | .ui-icon-arrow-1-se { background-position: -48px -32px; } 88 | .ui-icon-arrow-1-s { background-position: -64px -32px; } 89 | .ui-icon-arrow-1-sw { background-position: -80px -32px; } 90 | .ui-icon-arrow-1-w { background-position: -96px -32px; } 91 | .ui-icon-arrow-1-nw { background-position: -112px -32px; } 92 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } 93 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } 94 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } 95 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } 96 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } 97 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } 98 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } 99 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } 100 | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } 101 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } 102 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } 103 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } 104 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } 105 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } 106 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } 107 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } 108 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } 109 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } 110 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } 111 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } 112 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } 113 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } 114 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } 115 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } 116 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } 117 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } 118 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } 119 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } 120 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } 121 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } 122 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } 123 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } 124 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } 125 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } 126 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } 127 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } 128 | .ui-icon-arrow-4 { background-position: 0 -80px; } 129 | .ui-icon-arrow-4-diag { background-position: -16px -80px; } 130 | .ui-icon-extlink { background-position: -32px -80px; } 131 | .ui-icon-newwin { background-position: -48px -80px; } 132 | .ui-icon-refresh { background-position: -64px -80px; } 133 | .ui-icon-shuffle { background-position: -80px -80px; } 134 | .ui-icon-transfer-e-w { background-position: -96px -80px; } 135 | .ui-icon-transferthick-e-w { background-position: -112px -80px; } 136 | .ui-icon-folder-collapsed { background-position: 0 -96px; } 137 | .ui-icon-folder-open { background-position: -16px -96px; } 138 | .ui-icon-document { background-position: -32px -96px; } 139 | .ui-icon-document-b { background-position: -48px -96px; } 140 | .ui-icon-note { background-position: -64px -96px; } 141 | .ui-icon-mail-closed { background-position: -80px -96px; } 142 | .ui-icon-mail-open { background-position: -96px -96px; } 143 | .ui-icon-suitcase { background-position: -112px -96px; } 144 | .ui-icon-comment { background-position: -128px -96px; } 145 | .ui-icon-person { background-position: -144px -96px; } 146 | .ui-icon-print { background-position: -160px -96px; } 147 | .ui-icon-trash { background-position: -176px -96px; } 148 | .ui-icon-locked { background-position: -192px -96px; } 149 | .ui-icon-unlocked { background-position: -208px -96px; } 150 | .ui-icon-bookmark { background-position: -224px -96px; } 151 | .ui-icon-tag { background-position: -240px -96px; } 152 | .ui-icon-home { background-position: 0 -112px; } 153 | .ui-icon-flag { background-position: -16px -112px; } 154 | .ui-icon-calendar { background-position: -32px -112px; } 155 | .ui-icon-cart { background-position: -48px -112px; } 156 | .ui-icon-pencil { background-position: -64px -112px; } 157 | .ui-icon-clock { background-position: -80px -112px; } 158 | .ui-icon-disk { background-position: -96px -112px; } 159 | .ui-icon-calculator { background-position: -112px -112px; } 160 | .ui-icon-zoomin { background-position: -128px -112px; } 161 | .ui-icon-zoomout { background-position: -144px -112px; } 162 | .ui-icon-search { background-position: -160px -112px; } 163 | .ui-icon-wrench { background-position: -176px -112px; } 164 | .ui-icon-gear { background-position: -192px -112px; } 165 | .ui-icon-heart { background-position: -208px -112px; } 166 | .ui-icon-star { background-position: -224px -112px; } 167 | .ui-icon-link { background-position: -240px -112px; } 168 | .ui-icon-cancel { background-position: 0 -128px; } 169 | .ui-icon-plus { background-position: -16px -128px; } 170 | .ui-icon-plusthick { background-position: -32px -128px; } 171 | .ui-icon-minus { background-position: -48px -128px; } 172 | .ui-icon-minusthick { background-position: -64px -128px; } 173 | .ui-icon-close { background-position: -80px -128px; } 174 | .ui-icon-closethick { background-position: -96px -128px; } 175 | .ui-icon-key { background-position: -112px -128px; } 176 | .ui-icon-lightbulb { background-position: -128px -128px; } 177 | .ui-icon-scissors { background-position: -144px -128px; } 178 | .ui-icon-clipboard { background-position: -160px -128px; } 179 | .ui-icon-copy { background-position: -176px -128px; } 180 | .ui-icon-contact { background-position: -192px -128px; } 181 | .ui-icon-image { background-position: -208px -128px; } 182 | .ui-icon-video { background-position: -224px -128px; } 183 | .ui-icon-script { background-position: -240px -128px; } 184 | .ui-icon-alert { background-position: 0 -144px; } 185 | .ui-icon-info { background-position: -16px -144px; } 186 | .ui-icon-notice { background-position: -32px -144px; } 187 | .ui-icon-help { background-position: -48px -144px; } 188 | .ui-icon-check { background-position: -64px -144px; } 189 | .ui-icon-bullet { background-position: -80px -144px; } 190 | .ui-icon-radio-off { background-position: -96px -144px; } 191 | .ui-icon-radio-on { background-position: -112px -144px; } 192 | .ui-icon-pin-w { background-position: -128px -144px; } 193 | .ui-icon-pin-s { background-position: -144px -144px; } 194 | .ui-icon-play { background-position: 0 -160px; } 195 | .ui-icon-pause { background-position: -16px -160px; } 196 | .ui-icon-seek-next { background-position: -32px -160px; } 197 | .ui-icon-seek-prev { background-position: -48px -160px; } 198 | .ui-icon-seek-end { background-position: -64px -160px; } 199 | .ui-icon-seek-start { background-position: -80px -160px; } 200 | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ 201 | .ui-icon-seek-first { background-position: -80px -160px; } 202 | .ui-icon-stop { background-position: -96px -160px; } 203 | .ui-icon-eject { background-position: -112px -160px; } 204 | .ui-icon-volume-off { background-position: -128px -160px; } 205 | .ui-icon-volume-on { background-position: -144px -160px; } 206 | .ui-icon-power { background-position: 0 -176px; } 207 | .ui-icon-signal-diag { background-position: -16px -176px; } 208 | .ui-icon-signal { background-position: -32px -176px; } 209 | .ui-icon-battery-0 { background-position: -48px -176px; } 210 | .ui-icon-battery-1 { background-position: -64px -176px; } 211 | .ui-icon-battery-2 { background-position: -80px -176px; } 212 | .ui-icon-battery-3 { background-position: -96px -176px; } 213 | .ui-icon-circle-plus { background-position: 0 -192px; } 214 | .ui-icon-circle-minus { background-position: -16px -192px; } 215 | .ui-icon-circle-close { background-position: -32px -192px; } 216 | .ui-icon-circle-triangle-e { background-position: -48px -192px; } 217 | .ui-icon-circle-triangle-s { background-position: -64px -192px; } 218 | .ui-icon-circle-triangle-w { background-position: -80px -192px; } 219 | .ui-icon-circle-triangle-n { background-position: -96px -192px; } 220 | .ui-icon-circle-arrow-e { background-position: -112px -192px; } 221 | .ui-icon-circle-arrow-s { background-position: -128px -192px; } 222 | .ui-icon-circle-arrow-w { background-position: -144px -192px; } 223 | .ui-icon-circle-arrow-n { background-position: -160px -192px; } 224 | .ui-icon-circle-zoomin { background-position: -176px -192px; } 225 | .ui-icon-circle-zoomout { background-position: -192px -192px; } 226 | .ui-icon-circle-check { background-position: -208px -192px; } 227 | .ui-icon-circlesmall-plus { background-position: 0 -208px; } 228 | .ui-icon-circlesmall-minus { background-position: -16px -208px; } 229 | .ui-icon-circlesmall-close { background-position: -32px -208px; } 230 | .ui-icon-squaresmall-plus { background-position: -48px -208px; } 231 | .ui-icon-squaresmall-minus { background-position: -64px -208px; } 232 | .ui-icon-squaresmall-close { background-position: -80px -208px; } 233 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } 234 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } 235 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } 236 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } 237 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } 238 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } 239 | 240 | 241 | /* Misc visuals 242 | ----------------------------------*/ 243 | 244 | /* Corner radius */ 245 | .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; } 246 | .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } 247 | .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } 248 | .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } 249 | .ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } 250 | .ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } 251 | .ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } 252 | .ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } 253 | .ui-corner-all { -moz-border-radius: 4px/*{cornerRadius}*/; -webkit-border-radius: 4px/*{cornerRadius}*/; border-radius: 4px/*{cornerRadius}*/; } 254 | 255 | /* Overlays */ 256 | .ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; } 257 | .ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; } -------------------------------------------------------------------------------- /Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | using System.Web.Security; 8 | using BootstrapMVC.Models; 9 | 10 | namespace BootstrapMVC.Controllers 11 | { 12 | public class AccountController : Controller 13 | { 14 | 15 | // 16 | // GET: /Account/LogOn 17 | 18 | public ActionResult LogOn() 19 | { 20 | return View(); 21 | } 22 | 23 | // 24 | // POST: /Account/LogOn 25 | 26 | [HttpPost] 27 | public ActionResult LogOn(LogOnModel model, string returnUrl) 28 | { 29 | if (ModelState.IsValid) 30 | { 31 | if (Membership.ValidateUser(model.UserName, model.Password)) 32 | { 33 | FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe); 34 | if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/") 35 | && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\")) 36 | { 37 | return Redirect(returnUrl); 38 | } 39 | else 40 | { 41 | return RedirectToAction("Index", "Home"); 42 | } 43 | } 44 | else 45 | { 46 | ModelState.AddModelError("", "The user name or password provided is incorrect."); 47 | } 48 | } 49 | 50 | // If we got this far, something failed, redisplay form 51 | return View(model); 52 | } 53 | 54 | // 55 | // GET: /Account/LogOff 56 | 57 | public ActionResult LogOff() 58 | { 59 | FormsAuthentication.SignOut(); 60 | 61 | return RedirectToAction("Index", "Home"); 62 | } 63 | 64 | // 65 | // GET: /Account/Register 66 | 67 | public ActionResult Register() 68 | { 69 | return View(); 70 | } 71 | 72 | // 73 | // POST: /Account/Register 74 | 75 | [HttpPost] 76 | public ActionResult Register(RegisterModel model) 77 | { 78 | if (ModelState.IsValid) 79 | { 80 | // Attempt to register the user 81 | MembershipCreateStatus createStatus; 82 | Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus); 83 | 84 | if (createStatus == MembershipCreateStatus.Success) 85 | { 86 | FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */); 87 | return RedirectToAction("Index", "Home"); 88 | } 89 | else 90 | { 91 | ModelState.AddModelError("", ErrorCodeToString(createStatus)); 92 | } 93 | } 94 | 95 | // If we got this far, something failed, redisplay form 96 | return View(model); 97 | } 98 | 99 | // 100 | // GET: /Account/ChangePassword 101 | 102 | [Authorize] 103 | public ActionResult ChangePassword() 104 | { 105 | return View(); 106 | } 107 | 108 | // 109 | // POST: /Account/ChangePassword 110 | 111 | [Authorize] 112 | [HttpPost] 113 | public ActionResult ChangePassword(ChangePasswordModel model) 114 | { 115 | if (ModelState.IsValid) 116 | { 117 | 118 | // ChangePassword will throw an exception rather 119 | // than return false in certain failure scenarios. 120 | bool changePasswordSucceeded; 121 | try 122 | { 123 | MembershipUser currentUser = Membership.GetUser(User.Identity.Name, true /* userIsOnline */); 124 | changePasswordSucceeded = currentUser.ChangePassword(model.OldPassword, model.NewPassword); 125 | } 126 | catch (Exception) 127 | { 128 | changePasswordSucceeded = false; 129 | } 130 | 131 | if (changePasswordSucceeded) 132 | { 133 | return RedirectToAction("ChangePasswordSuccess"); 134 | } 135 | else 136 | { 137 | ModelState.AddModelError("", "The current password is incorrect or the new password is invalid."); 138 | } 139 | } 140 | 141 | // If we got this far, something failed, redisplay form 142 | return View(model); 143 | } 144 | 145 | // 146 | // GET: /Account/ChangePasswordSuccess 147 | 148 | public ActionResult ChangePasswordSuccess() 149 | { 150 | return View(); 151 | } 152 | 153 | #region Status Codes 154 | private static string ErrorCodeToString(MembershipCreateStatus createStatus) 155 | { 156 | // See http://go.microsoft.com/fwlink/?LinkID=177550 for 157 | // a full list of status codes. 158 | switch (createStatus) 159 | { 160 | case MembershipCreateStatus.DuplicateUserName: 161 | return "User name already exists. Please enter a different user name."; 162 | 163 | case MembershipCreateStatus.DuplicateEmail: 164 | return "A user name for that e-mail address already exists. Please enter a different e-mail address."; 165 | 166 | case MembershipCreateStatus.InvalidPassword: 167 | return "The password provided is invalid. Please enter a valid password value."; 168 | 169 | case MembershipCreateStatus.InvalidEmail: 170 | return "The e-mail address provided is invalid. Please check the value and try again."; 171 | 172 | case MembershipCreateStatus.InvalidAnswer: 173 | return "The password retrieval answer provided is invalid. Please check the value and try again."; 174 | 175 | case MembershipCreateStatus.InvalidQuestion: 176 | return "The password retrieval question provided is invalid. Please check the value and try again."; 177 | 178 | case MembershipCreateStatus.InvalidUserName: 179 | return "The user name provided is invalid. Please check the value and try again."; 180 | 181 | case MembershipCreateStatus.ProviderError: 182 | return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."; 183 | 184 | case MembershipCreateStatus.UserRejected: 185 | return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator."; 186 | 187 | default: 188 | return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."; 189 | } 190 | } 191 | #endregion 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace BootstrapMVC.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public ActionResult Index() 12 | { 13 | ViewBag.Message = "Welcome to ASP.NET MVC!"; 14 | 15 | return View(); 16 | } 17 | 18 | public ActionResult About() 19 | { 20 | return View(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="BootstrapMVC.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace BootstrapMVC 9 | { 10 | // Note: For instructions on enabling IIS6 or IIS7 classic mode, 11 | // visit http://go.microsoft.com/?LinkId=9394801 12 | 13 | public class MvcApplication : System.Web.HttpApplication 14 | { 15 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 16 | { 17 | filters.Add(new HandleErrorAttribute()); 18 | } 19 | 20 | public static void RegisterRoutes(RouteCollection routes) 21 | { 22 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 23 | 24 | routes.MapRoute( 25 | "Default", // Route name 26 | "{controller}/{action}/{id}", // URL with parameters 27 | new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults 28 | ); 29 | 30 | } 31 | 32 | protected void Application_Start() 33 | { 34 | AreaRegistration.RegisterAllAreas(); 35 | 36 | RegisterGlobalFilters(GlobalFilters.Filters); 37 | RegisterRoutes(RouteTable.Routes); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Models/AccountModels.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Globalization; 5 | using System.Web.Mvc; 6 | using System.Web.Security; 7 | 8 | namespace BootstrapMVC.Models 9 | { 10 | 11 | public class ChangePasswordModel 12 | { 13 | [Required] 14 | [DataType(DataType.Password)] 15 | [Display(Name = "Current password")] 16 | public string OldPassword { get; set; } 17 | 18 | [Required] 19 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 20 | [DataType(DataType.Password)] 21 | [Display(Name = "New password")] 22 | public string NewPassword { get; set; } 23 | 24 | [DataType(DataType.Password)] 25 | [Display(Name = "Confirm new password")] 26 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 27 | public string ConfirmPassword { get; set; } 28 | } 29 | 30 | public class LogOnModel 31 | { 32 | [Required] 33 | [Display(Name = "User name")] 34 | public string UserName { get; set; } 35 | 36 | [Required] 37 | [DataType(DataType.Password)] 38 | [Display(Name = "Password")] 39 | public string Password { get; set; } 40 | 41 | [Display(Name = "Remember me?")] 42 | public bool RememberMe { get; set; } 43 | } 44 | 45 | public class RegisterModel 46 | { 47 | [Required] 48 | [Display(Name = "User name")] 49 | public string UserName { get; set; } 50 | 51 | [Required] 52 | [DataType(DataType.EmailAddress)] 53 | [Display(Name = "Email address")] 54 | public string Email { get; set; } 55 | 56 | [Required] 57 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 58 | [DataType(DataType.Password)] 59 | [Display(Name = "Password")] 60 | public string Password { get; set; } 61 | 62 | [DataType(DataType.Password)] 63 | [Display(Name = "Confirm password")] 64 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 65 | public string ConfirmPassword { get; set; } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("BootstrapMVC")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("BootstrapMVC")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e3017aea-7fa3-4bcd-a1a7-d197c4b5600c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | BootstrapMVC is an ASP.NET MVC project using Twitter Bootstrap as its theme. 2 | To use it download the project file from the github repository and open the solution in Visual Studio.NET 2010 3 | 4 | project page: http://www.littlebigtomatoes.com/bootstrapmvc/ 5 | 6 | screenshot 7 | 8 | ![BootstrapMVC](http://www.littlebigtomatoes.com/images/BootstrapMVC-300x217.png) -------------------------------------------------------------------------------- /Scripts/MicrosoftMvcAjax.debug.js: -------------------------------------------------------------------------------- 1 | //!---------------------------------------------------------- 2 | //! Copyright (C) Microsoft Corporation. All rights reserved. 3 | //!---------------------------------------------------------- 4 | //! MicrosoftMvcAjax.js 5 | 6 | Type.registerNamespace('Sys.Mvc'); 7 | 8 | //////////////////////////////////////////////////////////////////////////////// 9 | // Sys.Mvc.AjaxOptions 10 | 11 | Sys.Mvc.$create_AjaxOptions = function Sys_Mvc_AjaxOptions() { return {}; } 12 | 13 | 14 | //////////////////////////////////////////////////////////////////////////////// 15 | // Sys.Mvc.InsertionMode 16 | 17 | Sys.Mvc.InsertionMode = function() { 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | /// 24 | }; 25 | Sys.Mvc.InsertionMode.prototype = { 26 | replace: 0, 27 | insertBefore: 1, 28 | insertAfter: 2 29 | } 30 | Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode', false); 31 | 32 | 33 | //////////////////////////////////////////////////////////////////////////////// 34 | // Sys.Mvc.AjaxContext 35 | 36 | Sys.Mvc.AjaxContext = function Sys_Mvc_AjaxContext(request, updateTarget, loadingElement, insertionMode) { 37 | /// 38 | /// 39 | /// 40 | /// 41 | /// 42 | /// 43 | /// 44 | /// 45 | /// 46 | /// 47 | /// 48 | /// 49 | /// 50 | /// 51 | /// 52 | /// 53 | /// 54 | /// 55 | this._request = request; 56 | this._updateTarget = updateTarget; 57 | this._loadingElement = loadingElement; 58 | this._insertionMode = insertionMode; 59 | } 60 | Sys.Mvc.AjaxContext.prototype = { 61 | _insertionMode: 0, 62 | _loadingElement: null, 63 | _response: null, 64 | _request: null, 65 | _updateTarget: null, 66 | 67 | get_data: function Sys_Mvc_AjaxContext$get_data() { 68 | /// 69 | if (this._response) { 70 | return this._response.get_responseData(); 71 | } 72 | else { 73 | return null; 74 | } 75 | }, 76 | 77 | get_insertionMode: function Sys_Mvc_AjaxContext$get_insertionMode() { 78 | /// 79 | return this._insertionMode; 80 | }, 81 | 82 | get_loadingElement: function Sys_Mvc_AjaxContext$get_loadingElement() { 83 | /// 84 | return this._loadingElement; 85 | }, 86 | 87 | get_object: function Sys_Mvc_AjaxContext$get_object() { 88 | /// 89 | var executor = this.get_response(); 90 | return (executor) ? executor.get_object() : null; 91 | }, 92 | 93 | get_response: function Sys_Mvc_AjaxContext$get_response() { 94 | /// 95 | return this._response; 96 | }, 97 | set_response: function Sys_Mvc_AjaxContext$set_response(value) { 98 | /// 99 | this._response = value; 100 | return value; 101 | }, 102 | 103 | get_request: function Sys_Mvc_AjaxContext$get_request() { 104 | /// 105 | return this._request; 106 | }, 107 | 108 | get_updateTarget: function Sys_Mvc_AjaxContext$get_updateTarget() { 109 | /// 110 | return this._updateTarget; 111 | } 112 | } 113 | 114 | 115 | //////////////////////////////////////////////////////////////////////////////// 116 | // Sys.Mvc.AsyncHyperlink 117 | 118 | Sys.Mvc.AsyncHyperlink = function Sys_Mvc_AsyncHyperlink() { 119 | } 120 | Sys.Mvc.AsyncHyperlink.handleClick = function Sys_Mvc_AsyncHyperlink$handleClick(anchor, evt, ajaxOptions) { 121 | /// 122 | /// 123 | /// 124 | /// 125 | /// 126 | /// 127 | evt.preventDefault(); 128 | Sys.Mvc.MvcHelpers._asyncRequest(anchor.href, 'post', '', anchor, ajaxOptions); 129 | } 130 | 131 | 132 | //////////////////////////////////////////////////////////////////////////////// 133 | // Sys.Mvc.MvcHelpers 134 | 135 | Sys.Mvc.MvcHelpers = function Sys_Mvc_MvcHelpers() { 136 | } 137 | Sys.Mvc.MvcHelpers._serializeSubmitButton = function Sys_Mvc_MvcHelpers$_serializeSubmitButton(element, offsetX, offsetY) { 138 | /// 139 | /// 140 | /// 141 | /// 142 | /// 143 | /// 144 | /// 145 | if (element.disabled) { 146 | return null; 147 | } 148 | var name = element.name; 149 | if (name) { 150 | var tagName = element.tagName.toUpperCase(); 151 | var encodedName = encodeURIComponent(name); 152 | var inputElement = element; 153 | if (tagName === 'INPUT') { 154 | var type = inputElement.type; 155 | if (type === 'submit') { 156 | return encodedName + '=' + encodeURIComponent(inputElement.value); 157 | } 158 | else if (type === 'image') { 159 | return encodedName + '.x=' + offsetX + '&' + encodedName + '.y=' + offsetY; 160 | } 161 | } 162 | else if ((tagName === 'BUTTON') && (name.length) && (inputElement.type === 'submit')) { 163 | return encodedName + '=' + encodeURIComponent(inputElement.value); 164 | } 165 | } 166 | return null; 167 | } 168 | Sys.Mvc.MvcHelpers._serializeForm = function Sys_Mvc_MvcHelpers$_serializeForm(form) { 169 | /// 170 | /// 171 | /// 172 | var formElements = form.elements; 173 | var formBody = new Sys.StringBuilder(); 174 | var count = formElements.length; 175 | for (var i = 0; i < count; i++) { 176 | var element = formElements[i]; 177 | var name = element.name; 178 | if (!name || !name.length) { 179 | continue; 180 | } 181 | var tagName = element.tagName.toUpperCase(); 182 | if (tagName === 'INPUT') { 183 | var inputElement = element; 184 | var type = inputElement.type; 185 | if ((type === 'text') || (type === 'password') || (type === 'hidden') || (((type === 'checkbox') || (type === 'radio')) && element.checked)) { 186 | formBody.append(encodeURIComponent(name)); 187 | formBody.append('='); 188 | formBody.append(encodeURIComponent(inputElement.value)); 189 | formBody.append('&'); 190 | } 191 | } 192 | else if (tagName === 'SELECT') { 193 | var selectElement = element; 194 | var optionCount = selectElement.options.length; 195 | for (var j = 0; j < optionCount; j++) { 196 | var optionElement = selectElement.options[j]; 197 | if (optionElement.selected) { 198 | formBody.append(encodeURIComponent(name)); 199 | formBody.append('='); 200 | formBody.append(encodeURIComponent(optionElement.value)); 201 | formBody.append('&'); 202 | } 203 | } 204 | } 205 | else if (tagName === 'TEXTAREA') { 206 | formBody.append(encodeURIComponent(name)); 207 | formBody.append('='); 208 | formBody.append(encodeURIComponent((element.value))); 209 | formBody.append('&'); 210 | } 211 | } 212 | var additionalInput = form._additionalInput; 213 | if (additionalInput) { 214 | formBody.append(additionalInput); 215 | formBody.append('&'); 216 | } 217 | return formBody.toString(); 218 | } 219 | Sys.Mvc.MvcHelpers._asyncRequest = function Sys_Mvc_MvcHelpers$_asyncRequest(url, verb, body, triggerElement, ajaxOptions) { 220 | /// 221 | /// 222 | /// 223 | /// 224 | /// 225 | /// 226 | /// 227 | /// 228 | /// 229 | /// 230 | if (ajaxOptions.confirm) { 231 | if (!confirm(ajaxOptions.confirm)) { 232 | return; 233 | } 234 | } 235 | if (ajaxOptions.url) { 236 | url = ajaxOptions.url; 237 | } 238 | if (ajaxOptions.httpMethod) { 239 | verb = ajaxOptions.httpMethod; 240 | } 241 | if (body.length > 0 && !body.endsWith('&')) { 242 | body += '&'; 243 | } 244 | body += 'X-Requested-With=XMLHttpRequest'; 245 | var upperCaseVerb = verb.toUpperCase(); 246 | var isGetOrPost = (upperCaseVerb === 'GET' || upperCaseVerb === 'POST'); 247 | if (!isGetOrPost) { 248 | body += '&'; 249 | body += 'X-HTTP-Method-Override=' + upperCaseVerb; 250 | } 251 | var requestBody = ''; 252 | if (upperCaseVerb === 'GET' || upperCaseVerb === 'DELETE') { 253 | if (url.indexOf('?') > -1) { 254 | if (!url.endsWith('&')) { 255 | url += '&'; 256 | } 257 | url += body; 258 | } 259 | else { 260 | url += '?'; 261 | url += body; 262 | } 263 | } 264 | else { 265 | requestBody = body; 266 | } 267 | var request = new Sys.Net.WebRequest(); 268 | request.set_url(url); 269 | if (isGetOrPost) { 270 | request.set_httpVerb(verb); 271 | } 272 | else { 273 | request.set_httpVerb('POST'); 274 | request.get_headers()['X-HTTP-Method-Override'] = upperCaseVerb; 275 | } 276 | request.set_body(requestBody); 277 | if (verb.toUpperCase() === 'PUT') { 278 | request.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded;'; 279 | } 280 | request.get_headers()['X-Requested-With'] = 'XMLHttpRequest'; 281 | var updateElement = null; 282 | if (ajaxOptions.updateTargetId) { 283 | updateElement = $get(ajaxOptions.updateTargetId); 284 | } 285 | var loadingElement = null; 286 | if (ajaxOptions.loadingElementId) { 287 | loadingElement = $get(ajaxOptions.loadingElementId); 288 | } 289 | var ajaxContext = new Sys.Mvc.AjaxContext(request, updateElement, loadingElement, ajaxOptions.insertionMode); 290 | var continueRequest = true; 291 | if (ajaxOptions.onBegin) { 292 | continueRequest = ajaxOptions.onBegin(ajaxContext) !== false; 293 | } 294 | if (loadingElement) { 295 | Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), true); 296 | } 297 | if (continueRequest) { 298 | request.add_completed(Function.createDelegate(null, function(executor) { 299 | Sys.Mvc.MvcHelpers._onComplete(request, ajaxOptions, ajaxContext); 300 | })); 301 | request.invoke(); 302 | } 303 | } 304 | Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request, ajaxOptions, ajaxContext) { 305 | /// 306 | /// 307 | /// 308 | /// 309 | /// 310 | /// 311 | ajaxContext.set_response(request.get_executor()); 312 | if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) { 313 | return; 314 | } 315 | var statusCode = ajaxContext.get_response().get_statusCode(); 316 | if ((statusCode >= 200 && statusCode < 300) || statusCode === 304 || statusCode === 1223) { 317 | if (statusCode !== 204 && statusCode !== 304 && statusCode !== 1223) { 318 | var contentType = ajaxContext.get_response().getResponseHeader('Content-Type'); 319 | if ((contentType) && (contentType.indexOf('application/x-javascript') !== -1)) { 320 | eval(ajaxContext.get_data()); 321 | } 322 | else { 323 | Sys.Mvc.MvcHelpers.updateDomElement(ajaxContext.get_updateTarget(), ajaxContext.get_insertionMode(), ajaxContext.get_data()); 324 | } 325 | } 326 | if (ajaxOptions.onSuccess) { 327 | ajaxOptions.onSuccess(ajaxContext); 328 | } 329 | } 330 | else { 331 | if (ajaxOptions.onFailure) { 332 | ajaxOptions.onFailure(ajaxContext); 333 | } 334 | } 335 | if (ajaxContext.get_loadingElement()) { 336 | Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), false); 337 | } 338 | } 339 | Sys.Mvc.MvcHelpers.updateDomElement = function Sys_Mvc_MvcHelpers$updateDomElement(target, insertionMode, content) { 340 | /// 341 | /// 342 | /// 343 | /// 344 | /// 345 | /// 346 | if (target) { 347 | switch (insertionMode) { 348 | case Sys.Mvc.InsertionMode.replace: 349 | target.innerHTML = content; 350 | break; 351 | case Sys.Mvc.InsertionMode.insertBefore: 352 | if (content && content.length > 0) { 353 | target.innerHTML = content + target.innerHTML.trimStart(); 354 | } 355 | break; 356 | case Sys.Mvc.InsertionMode.insertAfter: 357 | if (content && content.length > 0) { 358 | target.innerHTML = target.innerHTML.trimEnd() + content; 359 | } 360 | break; 361 | } 362 | } 363 | } 364 | 365 | 366 | //////////////////////////////////////////////////////////////////////////////// 367 | // Sys.Mvc.AsyncForm 368 | 369 | Sys.Mvc.AsyncForm = function Sys_Mvc_AsyncForm() { 370 | } 371 | Sys.Mvc.AsyncForm.handleClick = function Sys_Mvc_AsyncForm$handleClick(form, evt) { 372 | /// 373 | /// 374 | /// 375 | /// 376 | var additionalInput = Sys.Mvc.MvcHelpers._serializeSubmitButton(evt.target, evt.offsetX, evt.offsetY); 377 | form._additionalInput = additionalInput; 378 | } 379 | Sys.Mvc.AsyncForm.handleSubmit = function Sys_Mvc_AsyncForm$handleSubmit(form, evt, ajaxOptions) { 380 | /// 381 | /// 382 | /// 383 | /// 384 | /// 385 | /// 386 | evt.preventDefault(); 387 | var validationCallbacks = form.validationCallbacks; 388 | if (validationCallbacks) { 389 | for (var i = 0; i < validationCallbacks.length; i++) { 390 | var callback = validationCallbacks[i]; 391 | if (!callback()) { 392 | return; 393 | } 394 | } 395 | } 396 | var body = Sys.Mvc.MvcHelpers._serializeForm(form); 397 | Sys.Mvc.MvcHelpers._asyncRequest(form.action, form.method || 'post', body, form, ajaxOptions); 398 | } 399 | 400 | 401 | Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext'); 402 | Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink'); 403 | Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers'); 404 | Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); 405 | 406 | // ---- Do not remove this footer ---- 407 | // Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) 408 | // ----------------------------------- 409 | -------------------------------------------------------------------------------- /Scripts/MicrosoftMvcAjax.js: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------- 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | //---------------------------------------------------------- 4 | // MicrosoftMvcAjax.js 5 | 6 | Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_AjaxOptions=function(){return {};} 7 | Sys.Mvc.InsertionMode=function(){};Sys.Mvc.InsertionMode.prototype = {replace:0,insertBefore:1,insertAfter:2} 8 | Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode',false);Sys.Mvc.AjaxContext=function(request,updateTarget,loadingElement,insertionMode){this.$3=request;this.$4=updateTarget;this.$1=loadingElement;this.$0=insertionMode;} 9 | Sys.Mvc.AjaxContext.prototype={$0:0,$1:null,$2:null,$3:null,$4:null,get_data:function(){if(this.$2){return this.$2.get_responseData();}else{return null;}},get_insertionMode:function(){return this.$0;},get_loadingElement:function(){return this.$1;},get_object:function(){var $0=this.get_response();return ($0)?$0.get_object():null;},get_response:function(){return this.$2;},set_response:function(value){this.$2=value;return value;},get_request:function(){return this.$3;},get_updateTarget:function(){return this.$4;}} 10 | Sys.Mvc.AsyncHyperlink=function(){} 11 | Sys.Mvc.AsyncHyperlink.handleClick=function(anchor,evt,ajaxOptions){evt.preventDefault();Sys.Mvc.MvcHelpers.$2(anchor.href,'post','',anchor,ajaxOptions);} 12 | Sys.Mvc.MvcHelpers=function(){} 13 | Sys.Mvc.MvcHelpers.$0=function($p0,$p1,$p2){if($p0.disabled){return null;}var $0=$p0.name;if($0){var $1=$p0.tagName.toUpperCase();var $2=encodeURIComponent($0);var $3=$p0;if($1==='INPUT'){var $4=$3.type;if($4==='submit'){return $2+'='+encodeURIComponent($3.value);}else if($4==='image'){return $2+'.x='+$p1+'&'+$2+'.y='+$p2;}}else if(($1==='BUTTON')&&($0.length)&&($3.type==='submit')){return $2+'='+encodeURIComponent($3.value);}}return null;} 14 | Sys.Mvc.MvcHelpers.$1=function($p0){var $0=$p0.elements;var $1=new Sys.StringBuilder();var $2=$0.length;for(var $4=0;$4<$2;$4++){var $5=$0[$4];var $6=$5.name;if(!$6||!$6.length){continue;}var $7=$5.tagName.toUpperCase();if($7==='INPUT'){var $8=$5;var $9=$8.type;if(($9==='text')||($9==='password')||($9==='hidden')||((($9==='checkbox')||($9==='radio'))&&$5.checked)){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($8.value));$1.append('&');}}else if($7==='SELECT'){var $A=$5;var $B=$A.options.length;for(var $C=0;$C<$B;$C++){var $D=$A.options[$C];if($D.selected){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($D.value));$1.append('&');}}}else if($7==='TEXTAREA'){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent(($5.value)));$1.append('&');}}var $3=$p0._additionalInput;if($3){$1.append($3);$1.append('&');}return $1.toString();} 15 | Sys.Mvc.MvcHelpers.$2=function($p0,$p1,$p2,$p3,$p4){if($p4.confirm){if(!confirm($p4.confirm)){return;}}if($p4.url){$p0=$p4.url;}if($p4.httpMethod){$p1=$p4.httpMethod;}if($p2.length>0&&!$p2.endsWith('&')){$p2+='&';}$p2+='X-Requested-With=XMLHttpRequest';var $0=$p1.toUpperCase();var $1=($0==='GET'||$0==='POST');if(!$1){$p2+='&';$p2+='X-HTTP-Method-Override='+$0;}var $2='';if($0==='GET'||$0==='DELETE'){if($p0.indexOf('?')>-1){if(!$p0.endsWith('&')){$p0+='&';}$p0+=$p2;}else{$p0+='?';$p0+=$p2;}}else{$2=$p2;}var $3=new Sys.Net.WebRequest();$3.set_url($p0);if($1){$3.set_httpVerb($p1);}else{$3.set_httpVerb('POST');$3.get_headers()['X-HTTP-Method-Override']=$0;}$3.set_body($2);if($p1.toUpperCase()==='PUT'){$3.get_headers()['Content-Type']='application/x-www-form-urlencoded;';}$3.get_headers()['X-Requested-With']='XMLHttpRequest';var $4=null;if($p4.updateTargetId){$4=$get($p4.updateTargetId);}var $5=null;if($p4.loadingElementId){$5=$get($p4.loadingElementId);}var $6=new Sys.Mvc.AjaxContext($3,$4,$5,$p4.insertionMode);var $7=true;if($p4.onBegin){$7=$p4.onBegin($6)!==false;}if($5){Sys.UI.DomElement.setVisible($6.get_loadingElement(),true);}if($7){$3.add_completed(Function.createDelegate(null,function($p1_0){ 16 | Sys.Mvc.MvcHelpers.$3($3,$p4,$6);}));$3.invoke();}} 17 | Sys.Mvc.MvcHelpers.$3=function($p0,$p1,$p2){$p2.set_response($p0.get_executor());if($p1.onComplete&&$p1.onComplete($p2)===false){return;}var $0=$p2.get_response().get_statusCode();if(($0>=200&&$0<300)||$0===304||$0===1223){if($0!==204&&$0!==304&&$0!==1223){var $1=$p2.get_response().getResponseHeader('Content-Type');if(($1)&&($1.indexOf('application/x-javascript')!==-1)){eval($p2.get_data());}else{Sys.Mvc.MvcHelpers.updateDomElement($p2.get_updateTarget(),$p2.get_insertionMode(),$p2.get_data());}}if($p1.onSuccess){$p1.onSuccess($p2);}}else{if($p1.onFailure){$p1.onFailure($p2);}}if($p2.get_loadingElement()){Sys.UI.DomElement.setVisible($p2.get_loadingElement(),false);}} 18 | Sys.Mvc.MvcHelpers.updateDomElement=function(target,insertionMode,content){if(target){switch(insertionMode){case 0:target.innerHTML=content;break;case 1:if(content&&content.length>0){target.innerHTML=content+target.innerHTML.trimStart();}break;case 2:if(content&&content.length>0){target.innerHTML=target.innerHTML.trimEnd()+content;}break;}}} 19 | Sys.Mvc.AsyncForm=function(){} 20 | Sys.Mvc.AsyncForm.handleClick=function(form,evt){var $0=Sys.Mvc.MvcHelpers.$0(evt.target,evt.offsetX,evt.offsetY);form._additionalInput = $0;} 21 | Sys.Mvc.AsyncForm.handleSubmit=function(form,evt,ajaxOptions){evt.preventDefault();var $0=form.validationCallbacks;if($0){for(var $2=0;$2<$0.length;$2++){var $3=$0[$2];if(!$3()){return;}}}var $1=Sys.Mvc.MvcHelpers.$1(form);Sys.Mvc.MvcHelpers.$2(form.action,form.method||'post',$1,form,ajaxOptions);} 22 | Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); 23 | // ---- Do not remove this footer ---- 24 | // Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) 25 | // ----------------------------------- 26 | -------------------------------------------------------------------------------- /Scripts/MicrosoftMvcValidation.debug.js: -------------------------------------------------------------------------------- 1 | //!---------------------------------------------------------- 2 | //! Copyright (C) Microsoft Corporation. All rights reserved. 3 | //!---------------------------------------------------------- 4 | //! MicrosoftMvcValidation.js 5 | 6 | 7 | Type.registerNamespace('Sys.Mvc'); 8 | 9 | //////////////////////////////////////////////////////////////////////////////// 10 | // Sys.Mvc.Validation 11 | 12 | Sys.Mvc.$create_Validation = function Sys_Mvc_Validation() { return {}; } 13 | 14 | 15 | //////////////////////////////////////////////////////////////////////////////// 16 | // Sys.Mvc.JsonValidationField 17 | 18 | Sys.Mvc.$create_JsonValidationField = function Sys_Mvc_JsonValidationField() { return {}; } 19 | 20 | 21 | //////////////////////////////////////////////////////////////////////////////// 22 | // Sys.Mvc.JsonValidationOptions 23 | 24 | Sys.Mvc.$create_JsonValidationOptions = function Sys_Mvc_JsonValidationOptions() { return {}; } 25 | 26 | 27 | //////////////////////////////////////////////////////////////////////////////// 28 | // Sys.Mvc.JsonValidationRule 29 | 30 | Sys.Mvc.$create_JsonValidationRule = function Sys_Mvc_JsonValidationRule() { return {}; } 31 | 32 | 33 | //////////////////////////////////////////////////////////////////////////////// 34 | // Sys.Mvc.ValidationContext 35 | 36 | Sys.Mvc.$create_ValidationContext = function Sys_Mvc_ValidationContext() { return {}; } 37 | 38 | 39 | //////////////////////////////////////////////////////////////////////////////// 40 | // Sys.Mvc.NumberValidator 41 | 42 | Sys.Mvc.NumberValidator = function Sys_Mvc_NumberValidator() { 43 | } 44 | Sys.Mvc.NumberValidator.create = function Sys_Mvc_NumberValidator$create(rule) { 45 | /// 46 | /// 47 | /// 48 | return Function.createDelegate(new Sys.Mvc.NumberValidator(), new Sys.Mvc.NumberValidator().validate); 49 | } 50 | Sys.Mvc.NumberValidator.prototype = { 51 | 52 | validate: function Sys_Mvc_NumberValidator$validate(value, context) { 53 | /// 54 | /// 55 | /// 56 | /// 57 | /// 58 | if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { 59 | return true; 60 | } 61 | var n = Number.parseLocale(value); 62 | return (!isNaN(n)); 63 | } 64 | } 65 | 66 | 67 | //////////////////////////////////////////////////////////////////////////////// 68 | // Sys.Mvc.FormContext 69 | 70 | Sys.Mvc.FormContext = function Sys_Mvc_FormContext(formElement, validationSummaryElement) { 71 | /// 72 | /// 73 | /// 74 | /// 75 | /// 76 | /// 77 | /// 78 | /// 79 | /// 80 | /// 81 | /// 82 | /// 83 | /// 84 | /// 85 | /// 86 | /// 87 | /// 88 | /// 89 | /// 90 | /// 91 | /// 92 | /// 93 | /// 94 | /// 95 | /// 96 | /// 97 | /// 98 | /// 99 | this._errors = []; 100 | this.fields = new Array(0); 101 | this._formElement = formElement; 102 | this._validationSummaryElement = validationSummaryElement; 103 | formElement[Sys.Mvc.FormContext._formValidationTag] = this; 104 | if (validationSummaryElement) { 105 | var ulElements = validationSummaryElement.getElementsByTagName('ul'); 106 | if (ulElements.length > 0) { 107 | this._validationSummaryULElement = ulElements[0]; 108 | } 109 | } 110 | this._onClickHandler = Function.createDelegate(this, this._form_OnClick); 111 | this._onSubmitHandler = Function.createDelegate(this, this._form_OnSubmit); 112 | } 113 | Sys.Mvc.FormContext._Application_Load = function Sys_Mvc_FormContext$_Application_Load() { 114 | var allFormOptions = window.mvcClientValidationMetadata; 115 | if (allFormOptions) { 116 | while (allFormOptions.length > 0) { 117 | var thisFormOptions = allFormOptions.pop(); 118 | Sys.Mvc.FormContext._parseJsonOptions(thisFormOptions); 119 | } 120 | } 121 | } 122 | Sys.Mvc.FormContext._getFormElementsWithName = function Sys_Mvc_FormContext$_getFormElementsWithName(formElement, name) { 123 | /// 124 | /// 125 | /// 126 | /// 127 | /// 128 | var allElementsWithNameInForm = []; 129 | var allElementsWithName = document.getElementsByName(name); 130 | for (var i = 0; i < allElementsWithName.length; i++) { 131 | var thisElement = allElementsWithName[i]; 132 | if (Sys.Mvc.FormContext._isElementInHierarchy(formElement, thisElement)) { 133 | Array.add(allElementsWithNameInForm, thisElement); 134 | } 135 | } 136 | return allElementsWithNameInForm; 137 | } 138 | Sys.Mvc.FormContext.getValidationForForm = function Sys_Mvc_FormContext$getValidationForForm(formElement) { 139 | /// 140 | /// 141 | /// 142 | return formElement[Sys.Mvc.FormContext._formValidationTag]; 143 | } 144 | Sys.Mvc.FormContext._isElementInHierarchy = function Sys_Mvc_FormContext$_isElementInHierarchy(parent, child) { 145 | /// 146 | /// 147 | /// 148 | /// 149 | /// 150 | while (child) { 151 | if (parent === child) { 152 | return true; 153 | } 154 | child = child.parentNode; 155 | } 156 | return false; 157 | } 158 | Sys.Mvc.FormContext._parseJsonOptions = function Sys_Mvc_FormContext$_parseJsonOptions(options) { 159 | /// 160 | /// 161 | /// 162 | var formElement = $get(options.FormId); 163 | var validationSummaryElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(options.ValidationSummaryId)) ? $get(options.ValidationSummaryId) : null; 164 | var formContext = new Sys.Mvc.FormContext(formElement, validationSummaryElement); 165 | formContext.enableDynamicValidation(); 166 | formContext.replaceValidationSummary = options.ReplaceValidationSummary; 167 | for (var i = 0; i < options.Fields.length; i++) { 168 | var field = options.Fields[i]; 169 | var fieldElements = Sys.Mvc.FormContext._getFormElementsWithName(formElement, field.FieldName); 170 | var validationMessageElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(field.ValidationMessageId)) ? $get(field.ValidationMessageId) : null; 171 | var fieldContext = new Sys.Mvc.FieldContext(formContext); 172 | Array.addRange(fieldContext.elements, fieldElements); 173 | fieldContext.validationMessageElement = validationMessageElement; 174 | fieldContext.replaceValidationMessageContents = field.ReplaceValidationMessageContents; 175 | for (var j = 0; j < field.ValidationRules.length; j++) { 176 | var rule = field.ValidationRules[j]; 177 | var validator = Sys.Mvc.ValidatorRegistry.getValidator(rule); 178 | if (validator) { 179 | var validation = Sys.Mvc.$create_Validation(); 180 | validation.fieldErrorMessage = rule.ErrorMessage; 181 | validation.validator = validator; 182 | Array.add(fieldContext.validations, validation); 183 | } 184 | } 185 | fieldContext.enableDynamicValidation(); 186 | Array.add(formContext.fields, fieldContext); 187 | } 188 | var registeredValidatorCallbacks = formElement.validationCallbacks; 189 | if (!registeredValidatorCallbacks) { 190 | registeredValidatorCallbacks = []; 191 | formElement.validationCallbacks = registeredValidatorCallbacks; 192 | } 193 | registeredValidatorCallbacks.push(Function.createDelegate(null, function() { 194 | return Sys.Mvc._validationUtil.arrayIsNullOrEmpty(formContext.validate('submit')); 195 | })); 196 | return formContext; 197 | } 198 | Sys.Mvc.FormContext.prototype = { 199 | _onClickHandler: null, 200 | _onSubmitHandler: null, 201 | _submitButtonClicked: null, 202 | _validationSummaryElement: null, 203 | _validationSummaryULElement: null, 204 | _formElement: null, 205 | replaceValidationSummary: false, 206 | 207 | addError: function Sys_Mvc_FormContext$addError(message) { 208 | /// 209 | /// 210 | this.addErrors([ message ]); 211 | }, 212 | 213 | addErrors: function Sys_Mvc_FormContext$addErrors(messages) { 214 | /// 215 | /// 216 | if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) { 217 | Array.addRange(this._errors, messages); 218 | this._onErrorCountChanged(); 219 | } 220 | }, 221 | 222 | clearErrors: function Sys_Mvc_FormContext$clearErrors() { 223 | Array.clear(this._errors); 224 | this._onErrorCountChanged(); 225 | }, 226 | 227 | _displayError: function Sys_Mvc_FormContext$_displayError() { 228 | if (this._validationSummaryElement) { 229 | if (this._validationSummaryULElement) { 230 | Sys.Mvc._validationUtil.removeAllChildren(this._validationSummaryULElement); 231 | for (var i = 0; i < this._errors.length; i++) { 232 | var liElement = document.createElement('li'); 233 | Sys.Mvc._validationUtil.setInnerText(liElement, this._errors[i]); 234 | this._validationSummaryULElement.appendChild(liElement); 235 | } 236 | } 237 | Sys.UI.DomElement.removeCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss); 238 | Sys.UI.DomElement.addCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss); 239 | } 240 | }, 241 | 242 | _displaySuccess: function Sys_Mvc_FormContext$_displaySuccess() { 243 | var validationSummaryElement = this._validationSummaryElement; 244 | if (validationSummaryElement) { 245 | var validationSummaryULElement = this._validationSummaryULElement; 246 | if (validationSummaryULElement) { 247 | validationSummaryULElement.innerHTML = ''; 248 | } 249 | Sys.UI.DomElement.removeCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss); 250 | Sys.UI.DomElement.addCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss); 251 | } 252 | }, 253 | 254 | enableDynamicValidation: function Sys_Mvc_FormContext$enableDynamicValidation() { 255 | Sys.UI.DomEvent.addHandler(this._formElement, 'click', this._onClickHandler); 256 | Sys.UI.DomEvent.addHandler(this._formElement, 'submit', this._onSubmitHandler); 257 | }, 258 | 259 | _findSubmitButton: function Sys_Mvc_FormContext$_findSubmitButton(element) { 260 | /// 261 | /// 262 | /// 263 | if (element.disabled) { 264 | return null; 265 | } 266 | var tagName = element.tagName.toUpperCase(); 267 | var inputElement = element; 268 | if (tagName === 'INPUT') { 269 | var type = inputElement.type; 270 | if (type === 'submit' || type === 'image') { 271 | return inputElement; 272 | } 273 | } 274 | else if ((tagName === 'BUTTON') && (inputElement.type === 'submit')) { 275 | return inputElement; 276 | } 277 | return null; 278 | }, 279 | 280 | _form_OnClick: function Sys_Mvc_FormContext$_form_OnClick(e) { 281 | /// 282 | /// 283 | this._submitButtonClicked = this._findSubmitButton(e.target); 284 | }, 285 | 286 | _form_OnSubmit: function Sys_Mvc_FormContext$_form_OnSubmit(e) { 287 | /// 288 | /// 289 | var form = e.target; 290 | var submitButton = this._submitButtonClicked; 291 | if (submitButton && submitButton.disableValidation) { 292 | return; 293 | } 294 | var errorMessages = this.validate('submit'); 295 | if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(errorMessages)) { 296 | e.preventDefault(); 297 | } 298 | }, 299 | 300 | _onErrorCountChanged: function Sys_Mvc_FormContext$_onErrorCountChanged() { 301 | if (!this._errors.length) { 302 | this._displaySuccess(); 303 | } 304 | else { 305 | this._displayError(); 306 | } 307 | }, 308 | 309 | validate: function Sys_Mvc_FormContext$validate(eventName) { 310 | /// 311 | /// 312 | /// 313 | var fields = this.fields; 314 | var errors = []; 315 | for (var i = 0; i < fields.length; i++) { 316 | var field = fields[i]; 317 | if (!field.elements[0].disabled) { 318 | var thisErrors = field.validate(eventName); 319 | if (thisErrors) { 320 | Array.addRange(errors, thisErrors); 321 | } 322 | } 323 | } 324 | if (this.replaceValidationSummary) { 325 | this.clearErrors(); 326 | this.addErrors(errors); 327 | } 328 | return errors; 329 | } 330 | } 331 | 332 | 333 | //////////////////////////////////////////////////////////////////////////////// 334 | // Sys.Mvc.FieldContext 335 | 336 | Sys.Mvc.FieldContext = function Sys_Mvc_FieldContext(formContext) { 337 | /// 338 | /// 339 | /// 340 | /// 341 | /// 342 | /// 343 | /// 344 | /// 345 | /// 346 | /// 347 | /// 348 | /// 349 | /// 350 | /// 351 | /// 352 | /// 353 | /// 354 | /// 355 | /// 356 | /// 357 | /// 358 | /// 359 | /// 360 | /// 361 | /// 362 | /// 363 | /// 364 | /// 365 | /// 366 | /// 367 | /// 368 | /// 369 | /// 370 | /// 371 | /// 372 | /// 373 | this._errors = []; 374 | this.elements = new Array(0); 375 | this.validations = new Array(0); 376 | this.formContext = formContext; 377 | this._onBlurHandler = Function.createDelegate(this, this._element_OnBlur); 378 | this._onChangeHandler = Function.createDelegate(this, this._element_OnChange); 379 | this._onInputHandler = Function.createDelegate(this, this._element_OnInput); 380 | this._onPropertyChangeHandler = Function.createDelegate(this, this._element_OnPropertyChange); 381 | } 382 | Sys.Mvc.FieldContext.prototype = { 383 | _onBlurHandler: null, 384 | _onChangeHandler: null, 385 | _onInputHandler: null, 386 | _onPropertyChangeHandler: null, 387 | defaultErrorMessage: null, 388 | formContext: null, 389 | replaceValidationMessageContents: false, 390 | validationMessageElement: null, 391 | 392 | addError: function Sys_Mvc_FieldContext$addError(message) { 393 | /// 394 | /// 395 | this.addErrors([ message ]); 396 | }, 397 | 398 | addErrors: function Sys_Mvc_FieldContext$addErrors(messages) { 399 | /// 400 | /// 401 | if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) { 402 | Array.addRange(this._errors, messages); 403 | this._onErrorCountChanged(); 404 | } 405 | }, 406 | 407 | clearErrors: function Sys_Mvc_FieldContext$clearErrors() { 408 | Array.clear(this._errors); 409 | this._onErrorCountChanged(); 410 | }, 411 | 412 | _displayError: function Sys_Mvc_FieldContext$_displayError() { 413 | var validationMessageElement = this.validationMessageElement; 414 | if (validationMessageElement) { 415 | if (this.replaceValidationMessageContents) { 416 | Sys.Mvc._validationUtil.setInnerText(validationMessageElement, this._errors[0]); 417 | } 418 | Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss); 419 | Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss); 420 | } 421 | var elements = this.elements; 422 | for (var i = 0; i < elements.length; i++) { 423 | var element = elements[i]; 424 | Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss); 425 | Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss); 426 | } 427 | }, 428 | 429 | _displaySuccess: function Sys_Mvc_FieldContext$_displaySuccess() { 430 | var validationMessageElement = this.validationMessageElement; 431 | if (validationMessageElement) { 432 | if (this.replaceValidationMessageContents) { 433 | Sys.Mvc._validationUtil.setInnerText(validationMessageElement, ''); 434 | } 435 | Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss); 436 | Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss); 437 | } 438 | var elements = this.elements; 439 | for (var i = 0; i < elements.length; i++) { 440 | var element = elements[i]; 441 | Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss); 442 | Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss); 443 | } 444 | }, 445 | 446 | _element_OnBlur: function Sys_Mvc_FieldContext$_element_OnBlur(e) { 447 | /// 448 | /// 449 | if (e.target[Sys.Mvc.FieldContext._hasTextChangedTag] || e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) { 450 | this.validate('blur'); 451 | } 452 | }, 453 | 454 | _element_OnChange: function Sys_Mvc_FieldContext$_element_OnChange(e) { 455 | /// 456 | /// 457 | e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true; 458 | }, 459 | 460 | _element_OnInput: function Sys_Mvc_FieldContext$_element_OnInput(e) { 461 | /// 462 | /// 463 | e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true; 464 | if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) { 465 | this.validate('input'); 466 | } 467 | }, 468 | 469 | _element_OnPropertyChange: function Sys_Mvc_FieldContext$_element_OnPropertyChange(e) { 470 | /// 471 | /// 472 | if (e.rawEvent.propertyName === 'value') { 473 | e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true; 474 | if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) { 475 | this.validate('input'); 476 | } 477 | } 478 | }, 479 | 480 | enableDynamicValidation: function Sys_Mvc_FieldContext$enableDynamicValidation() { 481 | var elements = this.elements; 482 | for (var i = 0; i < elements.length; i++) { 483 | var element = elements[i]; 484 | if (Sys.Mvc._validationUtil.elementSupportsEvent(element, 'onpropertychange')) { 485 | var compatMode = document.documentMode; 486 | if (compatMode && compatMode >= 8) { 487 | Sys.UI.DomEvent.addHandler(element, 'propertychange', this._onPropertyChangeHandler); 488 | } 489 | } 490 | else { 491 | Sys.UI.DomEvent.addHandler(element, 'input', this._onInputHandler); 492 | } 493 | Sys.UI.DomEvent.addHandler(element, 'change', this._onChangeHandler); 494 | Sys.UI.DomEvent.addHandler(element, 'blur', this._onBlurHandler); 495 | } 496 | }, 497 | 498 | _getErrorString: function Sys_Mvc_FieldContext$_getErrorString(validatorReturnValue, fieldErrorMessage) { 499 | /// 500 | /// 501 | /// 502 | /// 503 | /// 504 | var fallbackErrorMessage = fieldErrorMessage || this.defaultErrorMessage; 505 | if (Boolean.isInstanceOfType(validatorReturnValue)) { 506 | return (validatorReturnValue) ? null : fallbackErrorMessage; 507 | } 508 | if (String.isInstanceOfType(validatorReturnValue)) { 509 | return ((validatorReturnValue).length) ? validatorReturnValue : fallbackErrorMessage; 510 | } 511 | return null; 512 | }, 513 | 514 | _getStringValue: function Sys_Mvc_FieldContext$_getStringValue() { 515 | /// 516 | var elements = this.elements; 517 | return (elements.length > 0) ? elements[0].value : null; 518 | }, 519 | 520 | _markValidationFired: function Sys_Mvc_FieldContext$_markValidationFired() { 521 | var elements = this.elements; 522 | for (var i = 0; i < elements.length; i++) { 523 | var element = elements[i]; 524 | element[Sys.Mvc.FieldContext._hasValidationFiredTag] = true; 525 | } 526 | }, 527 | 528 | _onErrorCountChanged: function Sys_Mvc_FieldContext$_onErrorCountChanged() { 529 | if (!this._errors.length) { 530 | this._displaySuccess(); 531 | } 532 | else { 533 | this._displayError(); 534 | } 535 | }, 536 | 537 | validate: function Sys_Mvc_FieldContext$validate(eventName) { 538 | /// 539 | /// 540 | /// 541 | var validations = this.validations; 542 | var errors = []; 543 | var value = this._getStringValue(); 544 | for (var i = 0; i < validations.length; i++) { 545 | var validation = validations[i]; 546 | var context = Sys.Mvc.$create_ValidationContext(); 547 | context.eventName = eventName; 548 | context.fieldContext = this; 549 | context.validation = validation; 550 | var retVal = validation.validator(value, context); 551 | var errorMessage = this._getErrorString(retVal, validation.fieldErrorMessage); 552 | if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(errorMessage)) { 553 | Array.add(errors, errorMessage); 554 | } 555 | } 556 | this._markValidationFired(); 557 | this.clearErrors(); 558 | this.addErrors(errors); 559 | return errors; 560 | } 561 | } 562 | 563 | 564 | //////////////////////////////////////////////////////////////////////////////// 565 | // Sys.Mvc.RangeValidator 566 | 567 | Sys.Mvc.RangeValidator = function Sys_Mvc_RangeValidator(minimum, maximum) { 568 | /// 569 | /// 570 | /// 571 | /// 572 | /// 573 | /// 574 | /// 575 | /// 576 | this._minimum = minimum; 577 | this._maximum = maximum; 578 | } 579 | Sys.Mvc.RangeValidator.create = function Sys_Mvc_RangeValidator$create(rule) { 580 | /// 581 | /// 582 | /// 583 | var min = rule.ValidationParameters['min']; 584 | var max = rule.ValidationParameters['max']; 585 | return Function.createDelegate(new Sys.Mvc.RangeValidator(min, max), new Sys.Mvc.RangeValidator(min, max).validate); 586 | } 587 | Sys.Mvc.RangeValidator.prototype = { 588 | _minimum: null, 589 | _maximum: null, 590 | 591 | validate: function Sys_Mvc_RangeValidator$validate(value, context) { 592 | /// 593 | /// 594 | /// 595 | /// 596 | /// 597 | if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { 598 | return true; 599 | } 600 | var n = Number.parseLocale(value); 601 | return (!isNaN(n) && this._minimum <= n && n <= this._maximum); 602 | } 603 | } 604 | 605 | 606 | //////////////////////////////////////////////////////////////////////////////// 607 | // Sys.Mvc.RegularExpressionValidator 608 | 609 | Sys.Mvc.RegularExpressionValidator = function Sys_Mvc_RegularExpressionValidator(pattern) { 610 | /// 611 | /// 612 | /// 613 | /// 614 | this._pattern = pattern; 615 | } 616 | Sys.Mvc.RegularExpressionValidator.create = function Sys_Mvc_RegularExpressionValidator$create(rule) { 617 | /// 618 | /// 619 | /// 620 | var pattern = rule.ValidationParameters['pattern']; 621 | return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator(pattern), new Sys.Mvc.RegularExpressionValidator(pattern).validate); 622 | } 623 | Sys.Mvc.RegularExpressionValidator.prototype = { 624 | _pattern: null, 625 | 626 | validate: function Sys_Mvc_RegularExpressionValidator$validate(value, context) { 627 | /// 628 | /// 629 | /// 630 | /// 631 | /// 632 | if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { 633 | return true; 634 | } 635 | var regExp = new RegExp(this._pattern); 636 | var matches = regExp.exec(value); 637 | return (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(matches) && matches[0].length === value.length); 638 | } 639 | } 640 | 641 | 642 | //////////////////////////////////////////////////////////////////////////////// 643 | // Sys.Mvc.RequiredValidator 644 | 645 | Sys.Mvc.RequiredValidator = function Sys_Mvc_RequiredValidator() { 646 | } 647 | Sys.Mvc.RequiredValidator.create = function Sys_Mvc_RequiredValidator$create(rule) { 648 | /// 649 | /// 650 | /// 651 | return Function.createDelegate(new Sys.Mvc.RequiredValidator(), new Sys.Mvc.RequiredValidator().validate); 652 | } 653 | Sys.Mvc.RequiredValidator._isRadioInputElement = function Sys_Mvc_RequiredValidator$_isRadioInputElement(element) { 654 | /// 655 | /// 656 | /// 657 | if (element.tagName.toUpperCase() === 'INPUT') { 658 | var inputType = (element.type).toUpperCase(); 659 | if (inputType === 'RADIO') { 660 | return true; 661 | } 662 | } 663 | return false; 664 | } 665 | Sys.Mvc.RequiredValidator._isSelectInputElement = function Sys_Mvc_RequiredValidator$_isSelectInputElement(element) { 666 | /// 667 | /// 668 | /// 669 | if (element.tagName.toUpperCase() === 'SELECT') { 670 | return true; 671 | } 672 | return false; 673 | } 674 | Sys.Mvc.RequiredValidator._isTextualInputElement = function Sys_Mvc_RequiredValidator$_isTextualInputElement(element) { 675 | /// 676 | /// 677 | /// 678 | if (element.tagName.toUpperCase() === 'INPUT') { 679 | var inputType = (element.type).toUpperCase(); 680 | switch (inputType) { 681 | case 'TEXT': 682 | case 'PASSWORD': 683 | case 'FILE': 684 | return true; 685 | } 686 | } 687 | if (element.tagName.toUpperCase() === 'TEXTAREA') { 688 | return true; 689 | } 690 | return false; 691 | } 692 | Sys.Mvc.RequiredValidator._validateRadioInput = function Sys_Mvc_RequiredValidator$_validateRadioInput(elements) { 693 | /// 694 | /// 695 | /// 696 | for (var i = 0; i < elements.length; i++) { 697 | var element = elements[i]; 698 | if (element.checked) { 699 | return true; 700 | } 701 | } 702 | return false; 703 | } 704 | Sys.Mvc.RequiredValidator._validateSelectInput = function Sys_Mvc_RequiredValidator$_validateSelectInput(optionElements) { 705 | /// 706 | /// 707 | /// 708 | for (var i = 0; i < optionElements.length; i++) { 709 | var element = optionElements[i]; 710 | if (element.selected) { 711 | if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value)) { 712 | return true; 713 | } 714 | } 715 | } 716 | return false; 717 | } 718 | Sys.Mvc.RequiredValidator._validateTextualInput = function Sys_Mvc_RequiredValidator$_validateTextualInput(element) { 719 | /// 720 | /// 721 | /// 722 | return (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value)); 723 | } 724 | Sys.Mvc.RequiredValidator.prototype = { 725 | 726 | validate: function Sys_Mvc_RequiredValidator$validate(value, context) { 727 | /// 728 | /// 729 | /// 730 | /// 731 | /// 732 | var elements = context.fieldContext.elements; 733 | if (!elements.length) { 734 | return true; 735 | } 736 | var sampleElement = elements[0]; 737 | if (Sys.Mvc.RequiredValidator._isTextualInputElement(sampleElement)) { 738 | return Sys.Mvc.RequiredValidator._validateTextualInput(sampleElement); 739 | } 740 | if (Sys.Mvc.RequiredValidator._isRadioInputElement(sampleElement)) { 741 | return Sys.Mvc.RequiredValidator._validateRadioInput(elements); 742 | } 743 | if (Sys.Mvc.RequiredValidator._isSelectInputElement(sampleElement)) { 744 | return Sys.Mvc.RequiredValidator._validateSelectInput((sampleElement).options); 745 | } 746 | return true; 747 | } 748 | } 749 | 750 | 751 | //////////////////////////////////////////////////////////////////////////////// 752 | // Sys.Mvc.StringLengthValidator 753 | 754 | Sys.Mvc.StringLengthValidator = function Sys_Mvc_StringLengthValidator(minLength, maxLength) { 755 | /// 756 | /// 757 | /// 758 | /// 759 | /// 760 | /// 761 | /// 762 | /// 763 | this._minLength = minLength; 764 | this._maxLength = maxLength; 765 | } 766 | Sys.Mvc.StringLengthValidator.create = function Sys_Mvc_StringLengthValidator$create(rule) { 767 | /// 768 | /// 769 | /// 770 | var minLength = (rule.ValidationParameters['min'] || 0); 771 | var maxLength = (rule.ValidationParameters['max'] || Number.MAX_VALUE); 772 | return Function.createDelegate(new Sys.Mvc.StringLengthValidator(minLength, maxLength), new Sys.Mvc.StringLengthValidator(minLength, maxLength).validate); 773 | } 774 | Sys.Mvc.StringLengthValidator.prototype = { 775 | _maxLength: 0, 776 | _minLength: 0, 777 | 778 | validate: function Sys_Mvc_StringLengthValidator$validate(value, context) { 779 | /// 780 | /// 781 | /// 782 | /// 783 | /// 784 | if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { 785 | return true; 786 | } 787 | return (this._minLength <= value.length && value.length <= this._maxLength); 788 | } 789 | } 790 | 791 | 792 | //////////////////////////////////////////////////////////////////////////////// 793 | // Sys.Mvc._validationUtil 794 | 795 | Sys.Mvc._validationUtil = function Sys_Mvc__validationUtil() { 796 | } 797 | Sys.Mvc._validationUtil.arrayIsNullOrEmpty = function Sys_Mvc__validationUtil$arrayIsNullOrEmpty(array) { 798 | /// 799 | /// 800 | /// 801 | return (!array || !array.length); 802 | } 803 | Sys.Mvc._validationUtil.stringIsNullOrEmpty = function Sys_Mvc__validationUtil$stringIsNullOrEmpty(value) { 804 | /// 805 | /// 806 | /// 807 | return (!value || !value.length); 808 | } 809 | Sys.Mvc._validationUtil.elementSupportsEvent = function Sys_Mvc__validationUtil$elementSupportsEvent(element, eventAttributeName) { 810 | /// 811 | /// 812 | /// 813 | /// 814 | /// 815 | return (eventAttributeName in element); 816 | } 817 | Sys.Mvc._validationUtil.removeAllChildren = function Sys_Mvc__validationUtil$removeAllChildren(element) { 818 | /// 819 | /// 820 | while (element.firstChild) { 821 | element.removeChild(element.firstChild); 822 | } 823 | } 824 | Sys.Mvc._validationUtil.setInnerText = function Sys_Mvc__validationUtil$setInnerText(element, innerText) { 825 | /// 826 | /// 827 | /// 828 | /// 829 | var textNode = document.createTextNode(innerText); 830 | Sys.Mvc._validationUtil.removeAllChildren(element); 831 | element.appendChild(textNode); 832 | } 833 | 834 | 835 | //////////////////////////////////////////////////////////////////////////////// 836 | // Sys.Mvc.ValidatorRegistry 837 | 838 | Sys.Mvc.ValidatorRegistry = function Sys_Mvc_ValidatorRegistry() { 839 | /// 840 | /// 841 | } 842 | Sys.Mvc.ValidatorRegistry.getValidator = function Sys_Mvc_ValidatorRegistry$getValidator(rule) { 843 | /// 844 | /// 845 | /// 846 | var creator = Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType]; 847 | return (creator) ? creator(rule) : null; 848 | } 849 | Sys.Mvc.ValidatorRegistry._getDefaultValidators = function Sys_Mvc_ValidatorRegistry$_getDefaultValidators() { 850 | /// 851 | return { required: Function.createDelegate(null, Sys.Mvc.RequiredValidator.create), length: Function.createDelegate(null, Sys.Mvc.StringLengthValidator.create), regex: Function.createDelegate(null, Sys.Mvc.RegularExpressionValidator.create), range: Function.createDelegate(null, Sys.Mvc.RangeValidator.create), number: Function.createDelegate(null, Sys.Mvc.NumberValidator.create) }; 852 | } 853 | 854 | 855 | Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator'); 856 | Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext'); 857 | Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext'); 858 | Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator'); 859 | Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator'); 860 | Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator'); 861 | Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator'); 862 | Sys.Mvc._validationUtil.registerClass('Sys.Mvc._validationUtil'); 863 | Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry'); 864 | Sys.Mvc.FormContext._validationSummaryErrorCss = 'validation-summary-errors'; 865 | Sys.Mvc.FormContext._validationSummaryValidCss = 'validation-summary-valid'; 866 | Sys.Mvc.FormContext._formValidationTag = '__MVC_FormValidation'; 867 | Sys.Mvc.FieldContext._hasTextChangedTag = '__MVC_HasTextChanged'; 868 | Sys.Mvc.FieldContext._hasValidationFiredTag = '__MVC_HasValidationFired'; 869 | Sys.Mvc.FieldContext._inputElementErrorCss = 'input-validation-error'; 870 | Sys.Mvc.FieldContext._inputElementValidCss = 'input-validation-valid'; 871 | Sys.Mvc.FieldContext._validationMessageErrorCss = 'field-validation-error'; 872 | Sys.Mvc.FieldContext._validationMessageValidCss = 'field-validation-valid'; 873 | Sys.Mvc.ValidatorRegistry.validators = Sys.Mvc.ValidatorRegistry._getDefaultValidators(); 874 | 875 | // ---- Do not remove this footer ---- 876 | // Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) 877 | // ----------------------------------- 878 | 879 | // register validation 880 | Sys.Application.add_load(function() { 881 | Sys.Application.remove_load(arguments.callee); 882 | Sys.Mvc.FormContext._Application_Load(); 883 | }); 884 | -------------------------------------------------------------------------------- /Scripts/MicrosoftMvcValidation.js: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------- 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | //---------------------------------------------------------- 4 | // MicrosoftMvcValidation.js 5 | 6 | Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_Validation=function(){return {};} 7 | Sys.Mvc.$create_JsonValidationField=function(){return {};} 8 | Sys.Mvc.$create_JsonValidationOptions=function(){return {};} 9 | Sys.Mvc.$create_JsonValidationRule=function(){return {};} 10 | Sys.Mvc.$create_ValidationContext=function(){return {};} 11 | Sys.Mvc.NumberValidator=function(){} 12 | Sys.Mvc.NumberValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.NumberValidator(),new Sys.Mvc.NumberValidator().validate);} 13 | Sys.Mvc.NumberValidator.prototype={validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0));}} 14 | Sys.Mvc.FormContext=function(formElement,validationSummaryElement){this.$5=[];this.fields=new Array(0);this.$9=formElement;this.$7=validationSummaryElement;formElement['__MVC_FormValidation'] = this;if(validationSummaryElement){var $0=validationSummaryElement.getElementsByTagName('ul');if($0.length>0){this.$8=$0[0];}}this.$3=Function.createDelegate(this,this.$D);this.$4=Function.createDelegate(this,this.$E);} 15 | Sys.Mvc.FormContext._Application_Load=function(){var $0=window.mvcClientValidationMetadata;if($0){while($0.length>0){var $1=$0.pop();Sys.Mvc.FormContext.$12($1);}}} 16 | Sys.Mvc.FormContext.$F=function($p0,$p1){var $0=[];var $1=document.getElementsByName($p1);for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];if(Sys.Mvc.FormContext.$10($p0,$3)){Array.add($0,$3);}}return $0;} 17 | Sys.Mvc.FormContext.getValidationForForm=function(formElement){return formElement['__MVC_FormValidation'];} 18 | Sys.Mvc.FormContext.$10=function($p0,$p1){while($p1){if($p0===$p1){return true;}$p1=$p1.parentNode;}return false;} 19 | Sys.Mvc.FormContext.$12=function($p0){var $0=$get($p0.FormId);var $1=(!Sys.Mvc._ValidationUtil.$1($p0.ValidationSummaryId))?$get($p0.ValidationSummaryId):null;var $2=new Sys.Mvc.FormContext($0,$1);$2.enableDynamicValidation();$2.replaceValidationSummary=$p0.ReplaceValidationSummary;for(var $4=0;$4<$p0.Fields.length;$4++){var $5=$p0.Fields[$4];var $6=Sys.Mvc.FormContext.$F($0,$5.FieldName);var $7=(!Sys.Mvc._ValidationUtil.$1($5.ValidationMessageId))?$get($5.ValidationMessageId):null;var $8=new Sys.Mvc.FieldContext($2);Array.addRange($8.elements,$6);$8.validationMessageElement=$7;$8.replaceValidationMessageContents=$5.ReplaceValidationMessageContents;for(var $9=0;$9<$5.ValidationRules.length;$9++){var $A=$5.ValidationRules[$9];var $B=Sys.Mvc.ValidatorRegistry.getValidator($A);if($B){var $C=Sys.Mvc.$create_Validation();$C.fieldErrorMessage=$A.ErrorMessage;$C.validator=$B;Array.add($8.validations,$C);}}$8.enableDynamicValidation();Array.add($2.fields,$8);}var $3=$0.validationCallbacks;if(!$3){$3=[];$0.validationCallbacks = $3;}$3.push(Function.createDelegate(null,function(){ 20 | return Sys.Mvc._ValidationUtil.$0($2.validate('submit'));}));return $2;} 21 | Sys.Mvc.FormContext.prototype={$3:null,$4:null,$6:null,$7:null,$8:null,$9:null,replaceValidationSummary:false,addError:function(message){this.addErrors([message]);},addErrors:function(messages){if(!Sys.Mvc._ValidationUtil.$0(messages)){Array.addRange(this.$5,messages);this.$11();}},clearErrors:function(){Array.clear(this.$5);this.$11();},$A:function(){if(this.$7){if(this.$8){Sys.Mvc._ValidationUtil.$3(this.$8);for(var $0=0;$0=8){Sys.UI.DomEvent.addHandler($2,'propertychange',this.$9);}}else{Sys.UI.DomEvent.addHandler($2,'input',this.$8);}Sys.UI.DomEvent.addHandler($2,'change',this.$7);Sys.UI.DomEvent.addHandler($2,'blur',this.$6);}},$11:function($p0,$p1){var $0=$p1||this.defaultErrorMessage;if(Boolean.isInstanceOfType($p0)){return ($p0)?null:$0;}if(String.isInstanceOfType($p0)){return (($p0).length)?$p0:$0;}return null;},$12:function(){var $0=this.elements;return ($0.length>0)?$0[0].value:null;},$13:function(){var $0=this.elements;for(var $1=0;$1<$0.length;$1++){var $2=$0[$1];$2['__MVC_HasValidationFired'] = true;}},$14:function(){if(!this.$A.length){this.$C();}else{this.$B();}},validate:function(eventName){var $0=this.validations;var $1=[];var $2=this.$12();for(var $3=0;$3<$0.length;$3++){var $4=$0[$3];var $5=Sys.Mvc.$create_ValidationContext();$5.eventName=eventName;$5.fieldContext=this;$5.validation=$4;var $6=$4.validator($2,$5);var $7=this.$11($6,$4.fieldErrorMessage);if(!Sys.Mvc._ValidationUtil.$1($7)){Array.add($1,$7);}}this.$13();this.clearErrors();this.addErrors($1);return $1;}} 24 | Sys.Mvc.RangeValidator=function(minimum,maximum){this.$0=minimum;this.$1=maximum;} 25 | Sys.Mvc.RangeValidator.create=function(rule){var $0=rule.ValidationParameters['min'];var $1=rule.ValidationParameters['max'];return Function.createDelegate(new Sys.Mvc.RangeValidator($0,$1),new Sys.Mvc.RangeValidator($0,$1).validate);} 26 | Sys.Mvc.RangeValidator.prototype={$0:null,$1:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0)&&this.$0<=$0&&$0<=this.$1);}} 27 | Sys.Mvc.RegularExpressionValidator=function(pattern){this.$0=pattern;} 28 | Sys.Mvc.RegularExpressionValidator.create=function(rule){var $0=rule.ValidationParameters['pattern'];return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator($0),new Sys.Mvc.RegularExpressionValidator($0).validate);} 29 | Sys.Mvc.RegularExpressionValidator.prototype={$0:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=new RegExp(this.$0);var $1=$0.exec(value);return (!Sys.Mvc._ValidationUtil.$0($1)&&$1[0].length===value.length);}} 30 | Sys.Mvc.RequiredValidator=function(){} 31 | Sys.Mvc.RequiredValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.RequiredValidator(),new Sys.Mvc.RequiredValidator().validate);} 32 | Sys.Mvc.RequiredValidator.$0=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();if($0==='RADIO'){return true;}}return false;} 33 | Sys.Mvc.RequiredValidator.$1=function($p0){if($p0.tagName.toUpperCase()==='SELECT'){return true;}return false;} 34 | Sys.Mvc.RequiredValidator.$2=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();switch($0){case 'TEXT':case 'PASSWORD':case 'FILE':return true;}}if($p0.tagName.toUpperCase()==='TEXTAREA'){return true;}return false;} 35 | Sys.Mvc.RequiredValidator.$3=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.checked){return true;}}return false;} 36 | Sys.Mvc.RequiredValidator.$4=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.selected){if(!Sys.Mvc._ValidationUtil.$1($1.value)){return true;}}}return false;} 37 | Sys.Mvc.RequiredValidator.$5=function($p0){return (!Sys.Mvc._ValidationUtil.$1($p0.value));} 38 | Sys.Mvc.RequiredValidator.prototype={validate:function(value,context){var $0=context.fieldContext.elements;if(!$0.length){return true;}var $1=$0[0];if(Sys.Mvc.RequiredValidator.$2($1)){return Sys.Mvc.RequiredValidator.$5($1);}if(Sys.Mvc.RequiredValidator.$0($1)){return Sys.Mvc.RequiredValidator.$3($0);}if(Sys.Mvc.RequiredValidator.$1($1)){return Sys.Mvc.RequiredValidator.$4(($1).options);}return true;}} 39 | Sys.Mvc.StringLengthValidator=function(minLength,maxLength){this.$1=minLength;this.$0=maxLength;} 40 | Sys.Mvc.StringLengthValidator.create=function(rule){var $0=(rule.ValidationParameters['min']||0);var $1=(rule.ValidationParameters['max']||Number.MAX_VALUE);return Function.createDelegate(new Sys.Mvc.StringLengthValidator($0,$1),new Sys.Mvc.StringLengthValidator($0,$1).validate);} 41 | Sys.Mvc.StringLengthValidator.prototype={$0:0,$1:0,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}return (this.$1<=value.length&&value.length<=this.$0);}} 42 | Sys.Mvc._ValidationUtil=function(){} 43 | Sys.Mvc._ValidationUtil.$0=function($p0){return (!$p0||!$p0.length);} 44 | Sys.Mvc._ValidationUtil.$1=function($p0){return (!$p0||!$p0.length);} 45 | Sys.Mvc._ValidationUtil.$2=function($p0,$p1){return ($p1 in $p0);} 46 | Sys.Mvc._ValidationUtil.$3=function($p0){while($p0.firstChild){$p0.removeChild($p0.firstChild);}} 47 | Sys.Mvc._ValidationUtil.$4=function($p0,$p1){var $0=document.createTextNode($p1);Sys.Mvc._ValidationUtil.$3($p0);$p0.appendChild($0);} 48 | Sys.Mvc.ValidatorRegistry=function(){} 49 | Sys.Mvc.ValidatorRegistry.getValidator=function(rule){var $0=Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType];return ($0)?$0(rule):null;} 50 | Sys.Mvc.ValidatorRegistry.$0=function(){return {required:Function.createDelegate(null,Sys.Mvc.RequiredValidator.create),length:Function.createDelegate(null,Sys.Mvc.StringLengthValidator.create),regex:Function.createDelegate(null,Sys.Mvc.RegularExpressionValidator.create),range:Function.createDelegate(null,Sys.Mvc.RangeValidator.create),number:Function.createDelegate(null,Sys.Mvc.NumberValidator.create)};} 51 | Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator');Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext');Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext');Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator');Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator');Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator');Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator');Sys.Mvc._ValidationUtil.registerClass('Sys.Mvc._ValidationUtil');Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry');Sys.Mvc.ValidatorRegistry.validators=Sys.Mvc.ValidatorRegistry.$0(); 52 | // ---- Do not remove this footer ---- 53 | // Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) 54 | // ----------------------------------- 55 | Sys.Application.add_load(function(){Sys.Application.remove_load(arguments.callee);Sys.Mvc.FormContext._Application_Load();}); -------------------------------------------------------------------------------- /Scripts/jquery.unobtrusive-ajax.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | /*! 4 | ** Unobtrusive Ajax support library for jQuery 5 | ** Copyright (C) Microsoft Corporation. All rights reserved. 6 | */ 7 | 8 | /*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ 9 | /*global window: false, jQuery: false */ 10 | 11 | (function ($) { 12 | var data_click = "unobtrusiveAjaxClick", 13 | data_validation = "unobtrusiveValidation"; 14 | 15 | function getFunction(code, argNames) { 16 | var fn = window, parts = (code || "").split("."); 17 | while (fn && parts.length) { 18 | fn = fn[parts.shift()]; 19 | } 20 | if (typeof (fn) === "function") { 21 | return fn; 22 | } 23 | argNames.push(code); 24 | return Function.constructor.apply(null, argNames); 25 | } 26 | 27 | function isMethodProxySafe(method) { 28 | return method === "GET" || method === "POST"; 29 | } 30 | 31 | function asyncOnBeforeSend(xhr, method) { 32 | if (!isMethodProxySafe(method)) { 33 | xhr.setRequestHeader("X-HTTP-Method-Override", method); 34 | } 35 | } 36 | 37 | function asyncOnSuccess(element, data, contentType) { 38 | var mode; 39 | 40 | if (contentType.indexOf("application/x-javascript") !== -1) { // jQuery already executes JavaScript for us 41 | return; 42 | } 43 | 44 | mode = (element.getAttribute("data-ajax-mode") || "").toUpperCase(); 45 | $(element.getAttribute("data-ajax-update")).each(function (i, update) { 46 | var top; 47 | 48 | switch (mode) { 49 | case "BEFORE": 50 | top = update.firstChild; 51 | $("
").html(data).contents().each(function () { 52 | update.insertBefore(this, top); 53 | }); 54 | break; 55 | case "AFTER": 56 | $("
").html(data).contents().each(function () { 57 | update.appendChild(this); 58 | }); 59 | break; 60 | default: 61 | $(update).html(data); 62 | break; 63 | } 64 | }); 65 | } 66 | 67 | function asyncRequest(element, options) { 68 | var confirm, loading, method, duration; 69 | 70 | confirm = element.getAttribute("data-ajax-confirm"); 71 | if (confirm && !window.confirm(confirm)) { 72 | return; 73 | } 74 | 75 | loading = $(element.getAttribute("data-ajax-loading")); 76 | duration = element.getAttribute("data-ajax-loading-duration") || 0; 77 | 78 | $.extend(options, { 79 | type: element.getAttribute("data-ajax-method") || undefined, 80 | url: element.getAttribute("data-ajax-url") || undefined, 81 | beforeSend: function (xhr) { 82 | var result; 83 | asyncOnBeforeSend(xhr, method); 84 | result = getFunction(element.getAttribute("data-ajax-begin"), ["xhr"]).apply(this, arguments); 85 | if (result !== false) { 86 | loading.show(duration); 87 | } 88 | return result; 89 | }, 90 | complete: function () { 91 | loading.hide(duration); 92 | getFunction(element.getAttribute("data-ajax-complete"), ["xhr", "status"]).apply(this, arguments); 93 | }, 94 | success: function (data, status, xhr) { 95 | asyncOnSuccess(element, data, xhr.getResponseHeader("Content-Type") || "text/html"); 96 | getFunction(element.getAttribute("data-ajax-success"), ["data", "status", "xhr"]).apply(this, arguments); 97 | }, 98 | error: getFunction(element.getAttribute("data-ajax-failure"), ["xhr", "status", "error"]) 99 | }); 100 | 101 | options.data.push({ name: "X-Requested-With", value: "XMLHttpRequest" }); 102 | 103 | method = options.type.toUpperCase(); 104 | if (!isMethodProxySafe(method)) { 105 | options.type = "POST"; 106 | options.data.push({ name: "X-HTTP-Method-Override", value: method }); 107 | } 108 | 109 | $.ajax(options); 110 | } 111 | 112 | function validate(form) { 113 | var validationInfo = $(form).data(data_validation); 114 | return !validationInfo || !validationInfo.validate || validationInfo.validate(); 115 | } 116 | 117 | $("a[data-ajax=true]").live("click", function (evt) { 118 | evt.preventDefault(); 119 | asyncRequest(this, { 120 | url: this.href, 121 | type: "GET", 122 | data: [] 123 | }); 124 | }); 125 | 126 | $("form[data-ajax=true] input[type=image]").live("click", function (evt) { 127 | var name = evt.target.name, 128 | $target = $(evt.target), 129 | form = $target.parents("form")[0], 130 | offset = $target.offset(); 131 | 132 | $(form).data(data_click, [ 133 | { name: name + ".x", value: Math.round(evt.pageX - offset.left) }, 134 | { name: name + ".y", value: Math.round(evt.pageY - offset.top) } 135 | ]); 136 | 137 | setTimeout(function () { 138 | $(form).removeData(data_click); 139 | }, 0); 140 | }); 141 | 142 | $("form[data-ajax=true] :submit").live("click", function (evt) { 143 | var name = evt.target.name, 144 | form = $(evt.target).parents("form")[0]; 145 | 146 | $(form).data(data_click, name ? [{ name: name, value: evt.target.value }] : []); 147 | 148 | setTimeout(function () { 149 | $(form).removeData(data_click); 150 | }, 0); 151 | }); 152 | 153 | $("form[data-ajax=true]").live("submit", function (evt) { 154 | var clickInfo = $(this).data(data_click) || []; 155 | evt.preventDefault(); 156 | if (!validate(this)) { 157 | return; 158 | } 159 | asyncRequest(this, { 160 | url: this.action, 161 | type: this.method || "GET", 162 | data: clickInfo.concat($(this).serializeArray()) 163 | }); 164 | }); 165 | }(jQuery)); -------------------------------------------------------------------------------- /Scripts/jquery.unobtrusive-ajax.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive Ajax support library for jQuery 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | (function(a){var b="unobtrusiveAjaxClick",g="unobtrusiveValidation";function c(d,b){var a=window,c=(d||"").split(".");while(a&&c.length)a=a[c.shift()];if(typeof a==="function")return a;b.push(d);return Function.constructor.apply(null,b)}function d(a){return a==="GET"||a==="POST"}function f(b,a){!d(a)&&b.setRequestHeader("X-HTTP-Method-Override",a)}function h(c,b,e){var d;if(e.indexOf("application/x-javascript")!==-1)return;d=(c.getAttribute("data-ajax-mode")||"").toUpperCase();a(c.getAttribute("data-ajax-update")).each(function(f,c){var e;switch(d){case"BEFORE":e=c.firstChild;a("
").html(b).contents().each(function(){c.insertBefore(this,e)});break;case"AFTER":a("
").html(b).contents().each(function(){c.appendChild(this)});break;default:a(c).html(b)}})}function e(b,e){var j,k,g,i;j=b.getAttribute("data-ajax-confirm");if(j&&!window.confirm(j))return;k=a(b.getAttribute("data-ajax-loading"));i=b.getAttribute("data-ajax-loading-duration")||0;a.extend(e,{type:b.getAttribute("data-ajax-method")||undefined,url:b.getAttribute("data-ajax-url")||undefined,beforeSend:function(d){var a;f(d,g);a=c(b.getAttribute("data-ajax-begin"),["xhr"]).apply(this,arguments);a!==false&&k.show(i);return a},complete:function(){k.hide(i);c(b.getAttribute("data-ajax-complete"),["xhr","status"]).apply(this,arguments)},success:function(a,e,d){h(b,a,d.getResponseHeader("Content-Type")||"text/html");c(b.getAttribute("data-ajax-success"),["data","status","xhr"]).apply(this,arguments)},error:c(b.getAttribute("data-ajax-failure"),["xhr","status","error"])});e.data.push({name:"X-Requested-With",value:"XMLHttpRequest"});g=e.type.toUpperCase();if(!d(g)){e.type="POST";e.data.push({name:"X-HTTP-Method-Override",value:g})}a.ajax(e)}function i(c){var b=a(c).data(g);return!b||!b.validate||b.validate()}a("a[data-ajax=true]").live("click",function(a){a.preventDefault();e(this,{url:this.href,type:"GET",data:[]})});a("form[data-ajax=true] input[type=image]").live("click",function(c){var g=c.target.name,d=a(c.target),f=d.parents("form")[0],e=d.offset();a(f).data(b,[{name:g+".x",value:Math.round(c.pageX-e.left)},{name:g+".y",value:Math.round(c.pageY-e.top)}]);setTimeout(function(){a(f).removeData(b)},0)});a("form[data-ajax=true] :submit").live("click",function(c){var e=c.target.name,d=a(c.target).parents("form")[0];a(d).data(b,e?[{name:e,value:c.target.value}]:[]);setTimeout(function(){a(d).removeData(b)},0)});a("form[data-ajax=true]").live("submit",function(d){var c=a(this).data(b)||[];d.preventDefault();if(!i(this))return;e(this,{url:this.action,type:this.method||"GET",data:c.concat(a(this).serializeArray())})})})(jQuery); -------------------------------------------------------------------------------- /Scripts/jquery.validate.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery Validation Plugin 1.8.0 10 | * 11 | * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ 12 | * http://docs.jquery.com/Plugins/Validation 13 | * 14 | * Copyright (c) 2006 - 2011 Jörn Zaefferer 15 | */ 16 | (function(c){c.extend(c.fn,{validate:function(a){if(this.length){var b=c.data(this[0],"validator");if(b)return b;b=new c.validator(a,this[0]);c.data(this[0],"validator",b);if(b.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){b.cancelSubmit=true});b.settings.submitHandler&&this.find("input, button").filter(":submit").click(function(){b.submitButton=this});this.submit(function(d){function e(){if(b.settings.submitHandler){if(b.submitButton)var f=c("").attr("name", 17 | b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);b.settings.submitHandler.call(b,b.currentForm);b.submitButton&&f.remove();return false}return true}b.settings.debug&&d.preventDefault();if(b.cancelSubmit){b.cancelSubmit=false;return e()}if(b.form()){if(b.pendingRequest){b.formSubmitted=true;return false}return e()}else{b.focusInvalid();return false}})}return b}else a&&a.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")},valid:function(){if(c(this[0]).is("form"))return this.validate().form(); 18 | else{var a=true,b=c(this[0].form).validate();this.each(function(){a&=b.element(this)});return a}},removeAttrs:function(a){var b={},d=this;c.each(a.split(/\s/),function(e,f){b[f]=d.attr(f);d.removeAttr(f)});return b},rules:function(a,b){var d=this[0];if(a){var e=c.data(d.form,"validator").settings,f=e.rules,g=c.validator.staticRules(d);switch(a){case "add":c.extend(g,c.validator.normalizeRule(b));f[d.name]=g;if(b.messages)e.messages[d.name]=c.extend(e.messages[d.name],b.messages);break;case "remove":if(!b){delete f[d.name]; 19 | return g}var h={};c.each(b.split(/\s/),function(j,i){h[i]=g[i];delete g[i]});return h}}d=c.validator.normalizeRules(c.extend({},c.validator.metadataRules(d),c.validator.classRules(d),c.validator.attributeRules(d),c.validator.staticRules(d)),d);if(d.required){e=d.required;delete d.required;d=c.extend({required:e},d)}return d}});c.extend(c.expr[":"],{blank:function(a){return!c.trim(""+a.value)},filled:function(a){return!!c.trim(""+a.value)},unchecked:function(a){return!a.checked}});c.validator=function(a, 20 | b){this.settings=c.extend(true,{},c.validator.defaults,a);this.currentForm=b;this.init()};c.validator.format=function(a,b){if(arguments.length==1)return function(){var d=c.makeArray(arguments);d.unshift(a);return c.validator.format.apply(this,d)};if(arguments.length>2&&b.constructor!=Array)b=c.makeArray(arguments).slice(1);if(b.constructor!=Array)b=[b];c.each(b,function(d,e){a=a.replace(RegExp("\\{"+d+"\\}","g"),e)});return a};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error", 21 | validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(a)).hide()}},onfocusout:function(a){if(!this.checkable(a)&&(a.name in this.submitted||!this.optional(a)))this.element(a)}, 22 | onkeyup:function(a){if(a.name in this.submitted||a==this.lastElement)this.element(a)},onclick:function(a){if(a.name in this.submitted)this.element(a);else a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(a,b,d){c(a).addClass(b).removeClass(d)},unhighlight:function(a,b,d){c(a).removeClass(b).addClass(d)}},setDefaults:function(a){c.extend(c.validator.defaults,a)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.", 23 | url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:c.validator.format("Please enter no more than {0} characters."),minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."), 24 | range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function a(e){var f=c.data(this[0].form,"validator");e="on"+e.type.replace(/^validate/,"");f.settings[e]&&f.settings[e].call(f,this[0])}this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&& 25 | this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=this.groups={};c.each(this.settings.groups,function(e,f){c.each(f.split(/\s/),function(g,h){b[h]=e})});var d=this.settings.rules;c.each(d,function(e,f){d[e]=c.validator.normalizeRule(f)});c(this.currentForm).validateDelegate(":text, :password, :file, select, textarea", 26 | "focusin focusout keyup",a).validateDelegate(":radio, :checkbox, select, option","click",a);this.settings.invalidHandler&&c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);this.valid()||c(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]); 27 | return this.valid()},element:function(a){this.lastElement=a=this.clean(a);this.prepareElement(a);this.currentElements=c(a);var b=this.check(a);if(b)delete this.invalid[a.name];else this.invalid[a.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return b},showErrors:function(a){if(a){c.extend(this.errorMap,a);this.errorList=[];for(var b in a)this.errorList.push({message:a[b],element:this.findByName(b)[0]});this.successList=c.grep(this.successList, 28 | function(d){return!(d.name in a)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){c.fn.resetForm&&c(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0,d;for(d in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()}, 29 | valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&c.grep(this.errorList,function(b){return b.element.name==a.name}).length==1&&a},elements:function(){var a=this,b={};return c([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&& 30 | a.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!a.objectLength(c(this).rules()))return false;return b[this.name]=true})},clean:function(a){return c(a)[0]},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)}, 31 | prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(a){a=this.clean(a);if(this.checkable(a))a=this.findByName(a.name).not(this.settings.ignore)[0];var b=c(a).rules(),d=false,e;for(e in b){var f={method:e,parameters:b[e]};try{var g=c.validator.methods[e].call(this,a.value.replace(/\r/g,""),a,f.parameters);if(g=="dependency-mismatch")d=true;else{d=false;if(g=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!g){this.formatAndAdd(a,f);return false}}}catch(h){this.settings.debug&& 32 | window.console&&console.log("exception occured when checking element "+a.id+", check the '"+f.method+"' method",h);throw h;}}if(!d){this.objectLength(b)&&this.successList.push(a);return true}},customMetaMessage:function(a,b){if(c.metadata){var d=this.settings.meta?c(a).metadata()[this.settings.meta]:c(a).metadata();return d&&d.messages&&d.messages[b]}},customMessage:function(a,b){var d=this.settings.messages[a];return d&&(d.constructor==String?d:d[b])},findDefined:function(){for(var a=0;aWarning: No message defined for "+a.name+"")},formatAndAdd:function(a,b){var d=this.defaultMessage(a,b.method),e=/\$?\{(\d+)\}/g;if(typeof d=="function")d=d.call(this,b.parameters,a);else if(e.test(d))d=jQuery.format(d.replace(e,"{$1}"),b.parameters);this.errorList.push({message:d, 34 | element:a});this.errorMap[a.name]=d;this.submitted[a.name]=d},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parent(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(a= 35 | 0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight){a=0;for(b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass)}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return c(this.errorList).map(function(){return this.element})},showLabel:function(a, 36 | b){var d=this.errorsFor(a);if(d.length){d.removeClass().addClass(this.settings.errorClass);d.attr("generated")&&d.html(b)}else{d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:true}).addClass(this.settings.errorClass).html(b||"");if(this.settings.wrapper)d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,c(a)):d.insertAfter(a))}if(!b&&this.settings.success){d.text(""); 37 | typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d)}this.toShow=this.toShow.add(d)},errorsFor:function(a){var b=this.idOrName(a);return this.errors().filter(function(){return c(this).attr("for")==b})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(a){var b=this.currentForm;return c(document.getElementsByName(a)).map(function(d,e){return e.form== 38 | b&&e.name==a&&e||null})},getLength:function(a,b){switch(b.nodeName.toLowerCase()){case "select":return c("option:selected",b).length;case "input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return a.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):true},dependTypes:{"boolean":function(a){return a},string:function(a,b){return!!c(a,b.form).length},"function":function(a,b){return a(b)}},optional:function(a){return!c.validator.methods.required.call(this, 39 | c.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(a,b){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[a.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();this.formSubmitted=false}else if(!b&&this.pendingRequest==0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted= 40 | false}},previousValue:function(a){return c.data(a,"previousValue")||c.data(a,"previousValue",{old:null,valid:true,message:this.defaultMessage(a,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(a,b){a.constructor==String?this.classRuleSettings[a]=b:c.extend(this.classRuleSettings, 41 | a)},classRules:function(a){var b={};(a=c(a).attr("class"))&&c.each(a.split(" "),function(){this in c.validator.classRuleSettings&&c.extend(b,c.validator.classRuleSettings[this])});return b},attributeRules:function(a){var b={};a=c(a);for(var d in c.validator.methods){var e=a.attr(d);if(e)b[d]=e}b.maxlength&&/-1|2147483647|524288/.test(b.maxlength)&&delete b.maxlength;return b},metadataRules:function(a){if(!c.metadata)return{};var b=c.data(a.form,"validator").settings.meta;return b?c(a).metadata()[b]: 42 | c(a).metadata()},staticRules:function(a){var b={},d=c.data(a.form,"validator");if(d.settings.rules)b=c.validator.normalizeRule(d.settings.rules[a.name])||{};return b},normalizeRules:function(a,b){c.each(a,function(d,e){if(e===false)delete a[d];else if(e.param||e.depends){var f=true;switch(typeof e.depends){case "string":f=!!c(e.depends,b.form).length;break;case "function":f=e.depends.call(b,b)}if(f)a[d]=e.param!==undefined?e.param:true;else delete a[d]}});c.each(a,function(d,e){a[d]=c.isFunction(e)? 43 | e(b):e});c.each(["minlength","maxlength","min","max"],function(){if(a[this])a[this]=Number(a[this])});c.each(["rangelength","range"],function(){if(a[this])a[this]=[Number(a[this][0]),Number(a[this][1])]});if(c.validator.autoCreateRanges){if(a.min&&a.max){a.range=[a.min,a.max];delete a.min;delete a.max}if(a.minlength&&a.maxlength){a.rangelength=[a.minlength,a.maxlength];delete a.minlength;delete a.maxlength}}a.messages&&delete a.messages;return a},normalizeRule:function(a){if(typeof a=="string"){var b= 44 | {};c.each(a.split(/\s/),function(){b[this]=true});a=b}return a},addMethod:function(a,b,d){c.validator.methods[a]=b;c.validator.messages[a]=d!=undefined?d:c.validator.messages[a];b.length<3&&c.validator.addClassRules(a,c.validator.normalizeRule(a))},methods:{required:function(a,b,d){if(!this.depend(d,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case "select":return(a=c(b).val())&&a.length>0;case "input":if(this.checkable(b))return this.getLength(a,b)>0;default:return c.trim(a).length> 45 | 0}},remote:function(a,b,d){if(this.optional(b))return"dependency-mismatch";var e=this.previousValue(b);this.settings.messages[b.name]||(this.settings.messages[b.name]={});e.originalMessage=this.settings.messages[b.name].remote;this.settings.messages[b.name].remote=e.message;d=typeof d=="string"&&{url:d}||d;if(this.pending[b.name])return"pending";if(e.old===a)return e.valid;e.old=a;var f=this;this.startRequest(b);var g={};g[b.name]=a;c.ajax(c.extend(true,{url:d,mode:"abort",port:"validate"+b.name, 46 | dataType:"json",data:g,success:function(h){f.settings.messages[b.name].remote=e.originalMessage;var j=h===true;if(j){var i=f.formSubmitted;f.prepareElement(b);f.formSubmitted=i;f.successList.push(b);f.showErrors()}else{i={};h=h||f.defaultMessage(b,"remote");i[b.name]=e.message=c.isFunction(h)?h(a):h;f.showErrors(i)}e.valid=j;f.stopRequest(b,j)}},d));return"pending"},minlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)>=d},maxlength:function(a,b,d){return this.optional(b)|| 47 | this.getLength(c.trim(a),b)<=d},rangelength:function(a,b,d){a=this.getLength(c.trim(a),b);return this.optional(b)||a>=d[0]&&a<=d[1]},min:function(a,b,d){return this.optional(b)||a>=d},max:function(a,b,d){return this.optional(b)||a<=d},range:function(a,b,d){return this.optional(b)||a>=d[0]&&a<=d[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a)}, 48 | url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)}, 49 | date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9-]+/.test(a))return false;var d=0,e=0,f=false;a=a.replace(/\D/g,"");for(var g=a.length-1;g>= 50 | 0;g--){e=a.charAt(g);e=parseInt(e,10);if(f)if((e*=2)>9)e-=9;d+=e;f=!f}return d%10==0},accept:function(a,b,d){d=typeof d=="string"?d.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||a.match(RegExp(".("+d+")$","i"))},equalTo:function(a,b,d){d=c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(b).valid()});return a==d.val()}}});c.format=c.validator.format})(jQuery); 51 | (function(c){var a={};if(c.ajaxPrefilter)c.ajaxPrefilter(function(d,e,f){e=d.port;if(d.mode=="abort"){a[e]&&a[e].abort();a[e]=f}});else{var b=c.ajax;c.ajax=function(d){var e=("port"in d?d:c.ajaxSettings).port;if(("mode"in d?d:c.ajaxSettings).mode=="abort"){a[e]&&a[e].abort();return a[e]=b.apply(this,arguments)}return b.apply(this,arguments)}}})(jQuery); 52 | (function(c){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.handle.call(this,e)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)},handler:function(e){arguments[0]=c.event.fix(e);arguments[0].type=b;return c.event.handle.apply(this,arguments)}}});c.extend(c.fn,{validateDelegate:function(a, 53 | b,d){return this.bind(b,function(e){var f=c(e.target);if(f.is(a))return d.apply(f,arguments)})}})})(jQuery); 54 | -------------------------------------------------------------------------------- /Scripts/jquery.validate.unobtrusive.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | /*! 5 | ** Unobtrusive validation support library for jQuery and jQuery Validate 6 | ** Copyright (C) Microsoft Corporation. All rights reserved. 7 | */ 8 | 9 | /*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ 10 | /*global document: false, jQuery: false */ 11 | 12 | (function ($) { 13 | var $jQval = $.validator, 14 | adapters, 15 | data_validation = "unobtrusiveValidation"; 16 | 17 | function setValidationValues(options, ruleName, value) { 18 | options.rules[ruleName] = value; 19 | if (options.message) { 20 | options.messages[ruleName] = options.message; 21 | } 22 | } 23 | 24 | function splitAndTrim(value) { 25 | return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g); 26 | } 27 | 28 | function getModelPrefix(fieldName) { 29 | return fieldName.substr(0, fieldName.lastIndexOf(".") + 1); 30 | } 31 | 32 | function appendModelPrefix(value, prefix) { 33 | if (value.indexOf("*.") === 0) { 34 | value = value.replace("*.", prefix); 35 | } 36 | return value; 37 | } 38 | 39 | function onError(error, inputElement) { // 'this' is the form element 40 | var container = $(this).find("[data-valmsg-for='" + inputElement[0].name + "']"), 41 | replace = $.parseJSON(container.attr("data-valmsg-replace")) !== false; 42 | 43 | container.removeClass("field-validation-valid").addClass("field-validation-error"); 44 | error.data("unobtrusiveContainer", container); 45 | 46 | if (replace) { 47 | container.empty(); 48 | error.removeClass("input-validation-error").appendTo(container); 49 | } 50 | else { 51 | error.hide(); 52 | } 53 | } 54 | 55 | function onErrors(form, validator) { // 'this' is the form element 56 | var container = $(this).find("[data-valmsg-summary=true]"), 57 | list = container.find("ul"); 58 | 59 | if (list && list.length && validator.errorList.length) { 60 | list.empty(); 61 | container.addClass("validation-summary-errors").removeClass("validation-summary-valid"); 62 | 63 | $.each(validator.errorList, function () { 64 | $("
  • ").html(this.message).appendTo(list); 65 | }); 66 | } 67 | } 68 | 69 | function onSuccess(error) { // 'this' is the form element 70 | var container = error.data("unobtrusiveContainer"), 71 | replace = $.parseJSON(container.attr("data-valmsg-replace")); 72 | 73 | if (container) { 74 | container.addClass("field-validation-valid").removeClass("field-validation-error"); 75 | error.removeData("unobtrusiveContainer"); 76 | 77 | if (replace) { 78 | container.empty(); 79 | } 80 | } 81 | } 82 | 83 | function validationInfo(form) { 84 | var $form = $(form), 85 | result = $form.data(data_validation); 86 | 87 | if (!result) { 88 | result = { 89 | options: { // options structure passed to jQuery Validate's validate() method 90 | errorClass: "input-validation-error", 91 | errorElement: "span", 92 | errorPlacement: $.proxy(onError, form), 93 | invalidHandler: $.proxy(onErrors, form), 94 | messages: {}, 95 | rules: {}, 96 | success: $.proxy(onSuccess, form) 97 | }, 98 | attachValidation: function () { 99 | $form.validate(this.options); 100 | }, 101 | validate: function () { // a validation function that is called by unobtrusive Ajax 102 | $form.validate(); 103 | return $form.valid(); 104 | } 105 | }; 106 | $form.data(data_validation, result); 107 | } 108 | 109 | return result; 110 | } 111 | 112 | $jQval.unobtrusive = { 113 | adapters: [], 114 | 115 | parseElement: function (element, skipAttach) { 116 | /// 117 | /// Parses a single HTML element for unobtrusive validation attributes. 118 | /// 119 | /// The HTML element to be parsed. 120 | /// [Optional] true to skip attaching the 121 | /// validation to the form. If parsing just this single element, you should specify true. 122 | /// If parsing several elements, you should specify false, and manually attach the validation 123 | /// to the form when you are finished. The default is false. 124 | var $element = $(element), 125 | form = $element.parents("form")[0], 126 | valInfo, rules, messages; 127 | 128 | if (!form) { // Cannot do client-side validation without a form 129 | return; 130 | } 131 | 132 | valInfo = validationInfo(form); 133 | valInfo.options.rules[element.name] = rules = {}; 134 | valInfo.options.messages[element.name] = messages = {}; 135 | 136 | $.each(this.adapters, function () { 137 | var prefix = "data-val-" + this.name, 138 | message = $element.attr(prefix), 139 | paramValues = {}; 140 | 141 | if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy) 142 | prefix += "-"; 143 | 144 | $.each(this.params, function () { 145 | paramValues[this] = $element.attr(prefix + this); 146 | }); 147 | 148 | this.adapt({ 149 | element: element, 150 | form: form, 151 | message: message, 152 | params: paramValues, 153 | rules: rules, 154 | messages: messages 155 | }); 156 | } 157 | }); 158 | 159 | jQuery.extend(rules, { "__dummy__": true }); 160 | 161 | if (!skipAttach) { 162 | valInfo.attachValidation(); 163 | } 164 | }, 165 | 166 | parse: function (selector) { 167 | /// 168 | /// Parses all the HTML elements in the specified selector. It looks for input elements decorated 169 | /// with the [data-val=true] attribute value and enables validation according to the data-val-* 170 | /// attribute values. 171 | /// 172 | /// Any valid jQuery selector. 173 | $(selector).find(":input[data-val=true]").each(function () { 174 | $jQval.unobtrusive.parseElement(this, true); 175 | }); 176 | 177 | $("form").each(function () { 178 | var info = validationInfo(this); 179 | if (info) { 180 | info.attachValidation(); 181 | } 182 | }); 183 | } 184 | }; 185 | 186 | adapters = $jQval.unobtrusive.adapters; 187 | 188 | adapters.add = function (adapterName, params, fn) { 189 | /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation. 190 | /// The name of the adapter to be added. This matches the name used 191 | /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). 192 | /// [Optional] An array of parameter names (strings) that will 193 | /// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and 194 | /// mmmm is the parameter name). 195 | /// The function to call, which adapts the values from the HTML 196 | /// attributes into jQuery Validate rules and/or messages. 197 | /// 198 | if (!fn) { // Called with no params, just a function 199 | fn = params; 200 | params = []; 201 | } 202 | this.push({ name: adapterName, params: params, adapt: fn }); 203 | return this; 204 | }; 205 | 206 | adapters.addBool = function (adapterName, ruleName) { 207 | /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where 208 | /// the jQuery Validate validation rule has no parameter values. 209 | /// The name of the adapter to be added. This matches the name used 210 | /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). 211 | /// [Optional] The name of the jQuery Validate rule. If not provided, the value 212 | /// of adapterName will be used instead. 213 | /// 214 | return this.add(adapterName, function (options) { 215 | setValidationValues(options, ruleName || adapterName, true); 216 | }); 217 | }; 218 | 219 | adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) { 220 | /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where 221 | /// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and 222 | /// one for min-and-max). The HTML parameters are expected to be named -min and -max. 223 | /// The name of the adapter to be added. This matches the name used 224 | /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). 225 | /// The name of the jQuery Validate rule to be used when you only 226 | /// have a minimum value. 227 | /// The name of the jQuery Validate rule to be used when you only 228 | /// have a maximum value. 229 | /// The name of the jQuery Validate rule to be used when you 230 | /// have both a minimum and maximum value. 231 | /// [Optional] The name of the HTML attribute that 232 | /// contains the minimum value. The default is "min". 233 | /// [Optional] The name of the HTML attribute that 234 | /// contains the maximum value. The default is "max". 235 | /// 236 | return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) { 237 | var min = options.params.min, 238 | max = options.params.max; 239 | 240 | if (min && max) { 241 | setValidationValues(options, minMaxRuleName, [min, max]); 242 | } 243 | else if (min) { 244 | setValidationValues(options, minRuleName, min); 245 | } 246 | else if (max) { 247 | setValidationValues(options, maxRuleName, max); 248 | } 249 | }); 250 | }; 251 | 252 | adapters.addSingleVal = function (adapterName, attribute, ruleName) { 253 | /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where 254 | /// the jQuery Validate validation rule has a single value. 255 | /// The name of the adapter to be added. This matches the name used 256 | /// in the data-val-nnnn HTML attribute(where nnnn is the adapter name). 257 | /// [Optional] The name of the HTML attribute that contains the value. 258 | /// The default is "val". 259 | /// [Optional] The name of the jQuery Validate rule. If not provided, the value 260 | /// of adapterName will be used instead. 261 | /// 262 | return this.add(adapterName, [attribute || "val"], function (options) { 263 | setValidationValues(options, ruleName || adapterName, options.params[attribute]); 264 | }); 265 | }; 266 | 267 | $jQval.addMethod("__dummy__", function (value, element, params) { 268 | return true; 269 | }); 270 | 271 | $jQval.addMethod("regex", function (value, element, params) { 272 | var match; 273 | if (this.optional(element)) { 274 | return true; 275 | } 276 | 277 | match = new RegExp(params).exec(value); 278 | return (match && (match.index === 0) && (match[0].length === value.length)); 279 | }); 280 | 281 | adapters.addSingleVal("accept", "exts").addSingleVal("regex", "pattern"); 282 | adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"); 283 | adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range"); 284 | adapters.add("equalto", ["other"], function (options) { 285 | var prefix = getModelPrefix(options.element.name), 286 | other = options.params.other, 287 | fullOtherName = appendModelPrefix(other, prefix), 288 | element = $(options.form).find(":input[name=" + fullOtherName + "]")[0]; 289 | 290 | setValidationValues(options, "equalTo", element); 291 | }); 292 | adapters.add("required", function (options) { 293 | // jQuery Validate equates "required" with "mandatory" for checkbox elements 294 | if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") { 295 | setValidationValues(options, "required", true); 296 | } 297 | }); 298 | adapters.add("remote", ["url", "type", "additionalfields"], function (options) { 299 | var value = { 300 | url: options.params.url, 301 | type: options.params.type || "GET", 302 | data: {} 303 | }, 304 | prefix = getModelPrefix(options.element.name); 305 | 306 | $.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) { 307 | var paramName = appendModelPrefix(fieldName, prefix); 308 | value.data[paramName] = function () { 309 | return $(options.form).find(":input[name='" + paramName + "']").val(); 310 | }; 311 | }); 312 | 313 | setValidationValues(options, "remote", value); 314 | }); 315 | 316 | $(function () { 317 | $jQval.unobtrusive.parse(document); 318 | }); 319 | }(jQuery)); -------------------------------------------------------------------------------- /Scripts/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | (function(a){var d=a.validator,b,f="unobtrusiveValidation";function c(a,b,c){a.rules[b]=c;if(a.message)a.messages[b]=a.message}function i(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function g(a){return a.substr(0,a.lastIndexOf(".")+1)}function e(a,b){if(a.indexOf("*.")===0)a=a.replace("*.",b);return a}function l(c,d){var b=a(this).find("[data-valmsg-for='"+d[0].name+"']"),e=a.parseJSON(b.attr("data-valmsg-replace"))!==false;b.removeClass("field-validation-valid").addClass("field-validation-error");c.data("unobtrusiveContainer",b);if(e){b.empty();c.removeClass("input-validation-error").appendTo(b)}else c.hide()}function k(e,d){var c=a(this).find("[data-valmsg-summary=true]"),b=c.find("ul");if(b&&b.length&&d.errorList.length){b.empty();c.addClass("validation-summary-errors").removeClass("validation-summary-valid");a.each(d.errorList,function(){a("
  • ").html(this.message).appendTo(b)})}}function j(c){var b=c.data("unobtrusiveContainer"),d=a.parseJSON(b.attr("data-valmsg-replace"));if(b){b.addClass("field-validation-valid").removeClass("field-validation-error");c.removeData("unobtrusiveContainer");d&&b.empty()}}function h(d){var b=a(d),c=b.data(f);if(!c){c={options:{errorClass:"input-validation-error",errorElement:"span",errorPlacement:a.proxy(l,d),invalidHandler:a.proxy(k,d),messages:{},rules:{},success:a.proxy(j,d)},attachValidation:function(){b.validate(this.options)},validate:function(){b.validate();return b.valid()}};b.data(f,c)}return c}d.unobtrusive={adapters:[],parseElement:function(b,i){var d=a(b),f=d.parents("form")[0],c,e,g;if(!f)return;c=h(f);c.options.rules[b.name]=e={};c.options.messages[b.name]=g={};a.each(this.adapters,function(){var c="data-val-"+this.name,i=d.attr(c),h={};if(i!==undefined){c+="-";a.each(this.params,function(){h[this]=d.attr(c+this)});this.adapt({element:b,form:f,message:i,params:h,rules:e,messages:g})}});jQuery.extend(e,{__dummy__:true});!i&&c.attachValidation()},parse:function(b){a(b).find(":input[data-val=true]").each(function(){d.unobtrusive.parseElement(this,true)});a("form").each(function(){var a=h(this);a&&a.attachValidation()})}};b=d.unobtrusive.adapters;b.add=function(c,a,b){if(!b){b=a;a=[]}this.push({name:c,params:a,adapt:b});return this};b.addBool=function(a,b){return this.add(a,function(d){c(d,b||a,true)})};b.addMinMax=function(e,g,f,a,d,b){return this.add(e,[d||"min",b||"max"],function(b){var e=b.params.min,d=b.params.max;if(e&&d)c(b,a,[e,d]);else if(e)c(b,g,e);else d&&c(b,f,d)})};b.addSingleVal=function(a,b,d){return this.add(a,[b||"val"],function(e){c(e,d||a,e.params[b])})};d.addMethod("__dummy__",function(){return true});d.addMethod("regex",function(b,c,d){var a;if(this.optional(c))return true;a=(new RegExp(d)).exec(b);return a&&a.index===0&&a[0].length===b.length});b.addSingleVal("accept","exts").addSingleVal("regex","pattern");b.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");b.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");b.add("equalto",["other"],function(b){var h=g(b.element.name),i=b.params.other,d=e(i,h),f=a(b.form).find(":input[name="+d+"]")[0];c(b,"equalTo",f)});b.add("required",function(a){(a.element.tagName.toUpperCase()!=="INPUT"||a.element.type.toUpperCase()!=="CHECKBOX")&&c(a,"required",true)});b.add("remote",["url","type","additionalfields"],function(b){var d={url:b.params.url,type:b.params.type||"GET",data:{}},f=g(b.element.name);a.each(i(b.params.additionalfields||b.element.name),function(h,g){var c=e(g,f);d.data[c]=function(){return a(b.form).find(":input[name='"+c+"']").val()}});c(b,"remote",d)});a(function(){d.unobtrusive.parse(document)})})(jQuery); -------------------------------------------------------------------------------- /Scripts/modernizr-1.7.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | */ 9 | // Modernizr v1.7 www.modernizr.com 10 | window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.rgba=function(){A("background-color:rgba(150,255,150,.5)");return D(k.backgroundColor,"rgba")},r.hsla=function(){A("background-color:hsla(120,40%,100%,.5)");return D(k.backgroundColor,"rgba")||D(k.backgroundColor,"hsla")},r.multiplebgs=function(){A("background:url(//:),url(//:),red url(//:)");return(new RegExp("(url\\s*\\(.*?){3}")).test(k.background)},r.backgroundsize=function(){return F("backgroundSize")},r.borderimage=function(){return F("borderImage")},r.borderradius=function(){return F("borderRadius","",function(a){return D(a,"orderRadius")})},r.boxshadow=function(){return F("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return F("animationName")},r.csscolumns=function(){return F("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";A((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return D(k.backgroundImage,"gradient")},r.cssreflections=function(){return F("boxReflect")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")},r.fontface=function(){var a,c,d=h||g,e=b.createElement("style"),f=b.implementation||{hasFeature:function(){return!1}};e.type="text/css",d.insertBefore(e,d.firstChild),a=e.sheet||e.styleSheet;var i=f.hasFeature("CSS2","")?function(b){if(!a||!b)return!1;var c=!1;try{a.insertRule(b,0),c=/src/i.test(a.cssRules[0].cssText),a.deleteRule(a.cssRules.length-1)}catch(d){}return c}:function(b){if(!a||!b)return!1;a.cssText=b;return a.cssText.length!==0&&/src/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(b.split(" ")[0])===0};c=i('@font-face { font-family: "font"; src: url(data:,); }'),d.removeChild(e);return c},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,f&&a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="";return a.childNodes.length!==1}()&&function(a,b){function p(a,b){var c=-1,d=a.length,e,f=[];while(++cChange Password 8 |

    9 | Use the form below to change your password. 10 |

    11 |

    12 | New passwords are required to be a minimum of @Membership.MinRequiredPasswordLength characters in length. 13 |

    14 | 15 | 16 | 17 | 18 | @using (Html.BeginForm()) { 19 | @Html.ValidationSummary(true, "Password change was unsuccessful. Please correct the errors and try again.") 20 |
    21 |
    22 | Account Information 23 | 24 |
    25 | @Html.LabelFor(m => m.OldPassword) 26 |
    27 |
    28 | @Html.PasswordFor(m => m.OldPassword) 29 | @Html.ValidationMessageFor(m => m.OldPassword) 30 |
    31 | 32 |
    33 | @Html.LabelFor(m => m.NewPassword) 34 |
    35 |
    36 | @Html.PasswordFor(m => m.NewPassword) 37 | @Html.ValidationMessageFor(m => m.NewPassword) 38 |
    39 | 40 |
    41 | @Html.LabelFor(m => m.ConfirmPassword) 42 |
    43 |
    44 | @Html.PasswordFor(m => m.ConfirmPassword) 45 | @Html.ValidationMessageFor(m => m.ConfirmPassword) 46 |
    47 | 48 |

    49 | 50 |

    51 |
    52 |
    53 | } 54 | -------------------------------------------------------------------------------- /Views/Account/ChangePasswordSuccess.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Change Password"; 3 | } 4 | 5 |

    Change Password

    6 |

    7 | Your password has been changed successfully. 8 |

    9 | -------------------------------------------------------------------------------- /Views/Account/LogOn.cshtml: -------------------------------------------------------------------------------- 1 | @model BootstrapMVC.Models.LogOnModel 2 | 3 | @{ 4 | ViewBag.Title = "Log On"; 5 | } 6 |
    7 | 10 |
    11 |
    12 |

    13 | Please enter your user name and password. @Html.ActionLink("Register", "Register") if you don't have an account. 14 |

    15 | 16 | 17 | 18 | @Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.") 19 | 20 | @using (Html.BeginForm()) { 21 |
    22 | Account Information 23 |
    24 | @Html.LabelFor(m => m.UserName) 25 |
    26 | @Html.TextBoxFor(m => m.UserName, new { @type = "text", @placeholder = "UserName", @class = "xlarge"}) 27 | @Html.ValidationMessageFor(m => m.UserName) 28 |
    29 |
    30 |
    31 | @Html.LabelFor(m => m.Password) 32 |
    33 | @Html.PasswordFor(m => m.Password, new { @placeholder = "Password", @class = "xlarge" }) 34 | @Html.ValidationMessageFor(m => m.Password) 35 |
    36 |
    37 |
    38 |
    39 | @Html.CheckBoxFor(m => m.RememberMe) 40 | Remember me? 41 |
    42 |
    43 |
    44 | 45 |
    46 |
    47 | } 48 | 49 |
    50 |
    51 |
    -------------------------------------------------------------------------------- /Views/Account/Register.cshtml: -------------------------------------------------------------------------------- 1 | @model BootstrapMVC.Models.RegisterModel 2 | 3 | @{ 4 | ViewBag.Title = "Register"; 5 | } 6 | 7 |
    8 | 11 |
    12 |
    13 |

    14 | Use the form below to create a new account. Passwords are required to be a minimum of @Membership.MinRequiredPasswordLength characters in length. 15 |

    16 | 17 | 18 | 19 | 20 | 21 | @using (Html.BeginForm()) { 22 | @Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.") 23 |
    24 | Account Information 25 | 26 |
    27 | @Html.LabelFor(m => m.UserName) 28 |
    29 | @Html.TextBoxFor(m => m.UserName) 30 | @Html.ValidationMessageFor(m => m.UserName) 31 |
    32 |
    33 | 34 |
    35 | @Html.LabelFor(m => m.Email) 36 |
    37 | @Html.TextBoxFor(m => m.Email) 38 | @Html.ValidationMessageFor(m => m.Email) 39 |
    40 |
    41 | 42 |
    43 | @Html.LabelFor(m => m.Password) 44 |
    45 | @Html.PasswordFor(m => m.Password) 46 | @Html.ValidationMessageFor(m => m.Password) 47 |
    48 |
    49 | 50 |
    51 | @Html.LabelFor(m => m.ConfirmPassword) 52 |
    53 | @Html.PasswordFor(m => m.ConfirmPassword) 54 | @Html.ValidationMessageFor(m => m.ConfirmPassword) 55 |
    56 |
    57 | 58 |
    59 | 60 |
    61 |
    62 | } 63 |
    64 |
    65 |
    -------------------------------------------------------------------------------- /Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "About Us"; 3 | } 4 |
    5 | 8 |
    9 |
    10 |

    11 | Put content here. 12 |

    13 |
    14 |
    15 |
    16 | -------------------------------------------------------------------------------- /Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Home Page"; 3 | } 4 |
    5 |

    @ViewBag.Message

    6 |

    ASP.NET MVC is a part of the ASP.NET Web application framework. It is one of the two different programming models you can use to create ASP.NET Web applications,the other being ASP.NET Web Forms.

    7 |

    Learn more »

    8 |
    9 |

    An MVC Application is designed and implemented using the following three attributes

    10 |
    11 |
    12 |

    Model

    13 |

    The model contains the core information for an application. This includes the data and validation rules as well as data access and aggregation logic.

    14 |

    Model details »

    15 |
    16 |
    17 |

    View

    18 |

    The view encapsulates the presentation of the application, and in ASP.NET this is typically the HTML markup.

    19 |

    View details »

    20 |
    21 |
    22 |

    Controller

    23 |

    The controller contains the control-flow logic. It interacts with the Model and Views to control the flow of information and execution of the application.

    24 |

    Controller details »

    25 |
    26 |
    -------------------------------------------------------------------------------- /Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Error"; 5 | } 6 | 7 |

    8 | Sorry, an error occurred while processing your request. 9 |

    10 | -------------------------------------------------------------------------------- /Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | @ViewBag.Title 6 | 7 | 8 | 9 | 15 | 16 | 17 | 31 |
    32 | @RenderBody() 33 |
    34 |

    © Company 2011

    35 |
    36 |
    37 | 38 | 39 | -------------------------------------------------------------------------------- /Views/Shared/_LogOnPartial.cshtml: -------------------------------------------------------------------------------- 1 | @if(Request.IsAuthenticated) { 2 | Welcome @User.Identity.Name! 3 | [ @Html.ActionLink("Log Off", "LogOff", "Account") ] 4 | } 5 | else { 6 | @: @Html.ActionLink("Log On", "LogOn", "Account") 7 | } 8 | -------------------------------------------------------------------------------- /Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | --------------------------------------------------------------------------------