Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0cf3206

Browse files
Added client side validation in asp.net core
1 parent 73d0194 commit 0cf3206

File tree

133 files changed

+5434
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+5434
-14
lines changed

‎Webgentle.BookStore/Webgentle.BookStore/Startup.cs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ public void ConfigureServices(IServiceCollection services)
2626

2727
services.AddControllersWithViews();
2828
#if DEBUG
29-
services.AddRazorPages().AddRazorRuntimeCompilation();
29+
services.AddRazorPages().AddRazorRuntimeCompilation();
30+
31+
// Uncomment this code to disable client side validations.
32+
// .AddViewOptions(option =>
33+
//{
34+
// option.HtmlHelperOptions.ClientValidationEnabled = false;
35+
//});
3036
#endif
3137
services.AddScoped<BookRepository, BookRepository>();
3238
services.AddScoped<LanguageRepository, LanguageRepository>();

‎Webgentle.BookStore/Webgentle.BookStore/Views/Shared/_Layout.cshtml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@
8282

8383
<environment include="Development">
8484
<script src="~/lib/jquery/jquery.js"></script>
85+
<script src="~/jquery-validate/jquery.validate.js"></script>
86+
<script src="~/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
8587
</environment>
8688
<environment exclude="Development">
8789
<script src="~/lib/jquery/jquery.min.js"></script>
90+
<script src="~/jquery-validate/jquery.validate.min.js"></script>
91+
<script src="~/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
8892
</environment>
8993

9094

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
{
2-
"version": "1.0",
3-
"defaultProvider": "cdnjs",
4-
"libraries": [
5-
{
6-
"library": "jquery@3.4.1",
7-
"destination": "wwwroot/lib/jquery/"
8-
},
9-
{
10-
"library": "twitter-bootstrap@4.4.1",
11-
"destination": "wwwroot/lib/twitter-bootstrap/"
12-
}
13-
]
1+
{
2+
"version": "1.0",
3+
"defaultProvider": "cdnjs",
4+
"libraries": [
5+
{
6+
"library": "jquery@3.4.1",
7+
"destination": "wwwroot/lib/jquery/"
8+
},
9+
{
10+
"library": "twitter-bootstrap@4.4.1",
11+
"destination": "wwwroot/lib/twitter-bootstrap/"
12+
},
13+
{
14+
"library": "jquery-validate@1.19.2",
15+
"destination": "wwwroot/jquery-validate/"
16+
},
17+
{
18+
"library": "jquery-validation-unobtrusive@3.2.11",
19+
"destination": "wwwroot/jquery-validation-unobtrusive/"
20+
}
21+
]
1422
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /