Repository navigation
ASPNET Core 5 MVC Bootstrap Responsive Web Programming Lecture 8 Model Validations
Full tutorial link > https://www.youtube.com/watch?v=StZ9bViQIuo
#SoftwareDevelopment #Software #Engineering #CSharp #Coding #Course
Asp.NET Core V5 - MVC Pattern - Bootstrap V5 - Responsive Web #Programming with C# Full Course Playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffsnAWtgk4ja3HN3xgMKF7BOE
GitHub repository of the course : https://github.com/FurkanGozukara/Responsive-Web-Design-With-ASP.NET-5-and-MVC-Pattern-and-BootStrap-5-2021
Discord channel link of the course : https://discord.gg/6Mrb8MwteQ
How to use Discord : https://youtu.be/AEwPtYiLvsQ
In Lecture 8:
-
How to define custom path and action name for server postbacks with Html.BeginForm
-
How to set requirements and validations to model properties
-
How to set custom requirement and validation messages to model properties
-
How to display requirement and validation results at the user screen at the client side
-
How to display validation summary at the client side
-
How to write more complex attribute routing
-
How to generate a custom validation for model properties with inheriting ValidationAttribute
-
What types of requirements there are that we can enforce to model properties
-
How to modify display of model attributes
-
How to format display of model attributes at the client side
-
How to set different input types at the client side with using type property of Html.TextBoxFor
last page : https://asp.mvc-tutorial.com/layout/introduction/
Please subscribe and make comments.
This course requires fundamental knowledge about programming and C#. So please watch our below playlists related to C#.
Our courses playlists are like below:
[1] Introduction to Programming Full Course with C# playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffskoSXySh0MdiayPJsBZ7m2o
[2] Advanced #Programming with C# Full Course Playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffslHaBdS3RUW26RKzSjkl8m4
[3] Object Oriented Programming Full Course with C# playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffsnH3XJb66FDIHh1yHwWC26I
[4] Asp.NET Core V5 - MVC Pattern - Bootstrap V5 - Responsive Web #Programming with C# Full Course Playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffsnAWtgk4ja3HN3xgMKF7BOE
[5] Artificial Intelligence (AI) and Machine Learning (ML) Full Course with C# Examples playlist: https://www.youtube.com/playlist?list=PL_pbwdIyffskVschrADCL6KEnL_nqDtgD
[6] Software Engineering Full Course playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffslgxMVyXhnHiSn_EWTvx1G-
[7] Security of Information Systems Full Course playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffslM_o92NwkaUzD7C6Fekx26
[8] (Turkish) Bilgisayar Becerileri Tam Ders playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffsmyE2e909ea1MXLcMb8MenG
auto subtitle timing : NA
-
00:00:01 Hello students, welcome to the lecture 8 of responsive web design with asp.net 5 and MVC
-
00:00:05 pattern and moose track 5.
-
00:00:06 So today we will continue from where we have left in the previous lecture in the lecture
-
00:00:15 seven.
-
00:00:16 We have seen modern binding at the end.
-
00:00:20 So let's start with cloning or latest project as usual.
-
00:00:28 So that you can access each of them individually from GitHub.
-
00:00:32 You could also do that with GitHub versioning branching, but it may be harder for who is
-
00:00:41 not accustomed to GitHub repository management.
-
00:00:45 Therefore.
-
00:00:46 I am cloning each time the project.
-
00:00:49 Okay.
-
00:00:50 So in the model binding we were able to bind
-
00:00:53 The parameters to our model and at the code behind they were automatically getting bond
-
00:01:03 in a moment.
-
00:01:06 I will show that I'm even remember it.
-
00:01:10 So it was much easier to use than old-school HTML form posting and such.
-
00:01:20 Okay, so let's rename our lecture to 8.
-
00:01:27 Okay.
-
00:01:30 Okay used to be have negative seven controller and here we should have model Bond.
-
00:01:43 version
-
00:01:45 Okay, none of these are taking.
-
00:01:54 Model we need action that takes model Maybe.
-
00:01:59 It's opposing sides.
-
00:02:03 Another thing.
-
00:02:05 Okay.
-
00:02:07 Binding controllers.
-
00:02:08 Okay, here you see this action result is taking a model as an input.
-
00:02:18 This is how we bind formed and model.
-
00:02:23 Let's go to the wave of this controller.
-
00:02:28 And we were using Entity framework to do our database operations.
-
00:02:35 So it will be insights bindings.
-
00:02:39 Folder.
-
00:02:40 Okay.
-
00:02:42 Okay, so this is how we generate a model using HTML form and this is how we bind parameters.
-
00:02:55 So,
-
00:02:56 Yeah, this is it.
-
00:03:00 So let's continue to our tutorial.
-
00:03:04 Okay so the next article is
-
00:03:07 Data and annotations.
-
00:03:14 Okay.
-
00:03:16 In the previous article, we started digging into the very relevant subject of model, binding
-
00:03:22 with model binding.
-
00:03:23 We can create a stronger connection between the model and the view.
-
00:03:26 And in return, we get a lot of help in the creation of markup.
-
00:03:30 And processing of requests, the view, simply reads your model class, and then uses the
-
00:03:35 available information to help you EG by creating a relevant textbox control for a property
-
00:03:41 in a form.
-
00:03:42 Okay.
-
00:03:43 So let's run our application to the man.
-
00:03:48 there's,
-
00:03:49 you see there is a label for this is an i HTML helper method, and there is text box
-
00:04:00 for
-
00:04:01 Asp.net MVC and join is generating, relevant HTML code.
-
00:04:10 From this server side code and simply there is submit and there is the form.
-
00:04:17 Okay, so where does this form?
-
00:04:21 Get the post address?
-
00:04:26 I think it is simply posting to whatever the page it is.
-
00:04:32 So it is posting
-
00:04:33 two
-
00:04:36 by default since we didn't Define anything index of binding control.
-
00:04:42 Yes.
-
00:04:44 We also had defined it attribute routing and post.
-
00:04:52 Let's say HTTP post full drink.
-
00:04:57 Okay good.
-
00:04:58 So you see first name parameter last name parameter, we can all of course customize
-
00:05:03 this and we will see them.
-
00:05:05 So let's go
-
00:05:07 To you.
-
00:05:10 However, sometimes it can be relevant for your views to know more about a property on
-
00:05:15 your model than just its name and type for these situations.
-
00:05:19 Asp.net MVC, comes with the concept of data annotations, sometimes referred to as model
-
00:05:25 attributes which basically allows you to add metadata to a property.
-
00:05:30 The cool thing about data annotations is that they don't disturb the use of your models
-
00:05:34 outside of the MVC framework, I think modal attributes sounds better more.
-
00:05:39 Explain it.
-
00:05:41 To okay.
-
00:05:43 So how to use data and annotations how to use data annotations.
-
00:05:50 Allow me to give you a quick idea of how data annotations work.
-
00:05:54 For instance a very common scenario, which we actually saw in the previous article is
-
00:05:59 that we would like to have the framework generate a label and an input field for a property
-
00:06:04 when generating the label the name of the property is used but property names are generally
-
00:06:09 not nice to look at for humans as an example of that.
-
00:06:13 We might want to change the display version of the first name property to first name.
-
00:06:18 With data annotations, that's very easy.
-
00:06:21 Okay.
-
00:06:22 So let's remember what was happening Weaver's setting same parameter name.
-
00:06:32 So this parameter name this property comes from our model.
-
00:06:38 I think I will duplicate code.
-
00:06:42 So the lecture 7 will remain as well.
-
00:06:46 or just
-
00:06:48 Let's change this lecture age, perhaps.
-
00:06:54 Let me know.
-
00:06:56 Okay, let's keep the lecture 7.
-
00:06:59 So let's add lecture 8, it will be a controller.
-
00:07:05 Okay, add
-
00:07:09 Okay, lecture 8.
-
00:07:14 And this will use.
-
00:07:22 More than of lecture 7, I'm going to duplicate that as well.
-
00:07:32 Make sure 7.
-
00:07:36 Okay?
-
00:07:37 And let's copy and paste this into here.
-
00:07:41 Let's copy and okay.
-
00:07:43 This doesn't have an ending controller, so I have to fix that.
-
00:07:46 Okay.
-
00:07:47 Yes, all the references are renamed it.
-
00:07:54 And let's copy and paste these methods.
-
00:08:00 Actually, we just need to get the binding controls methods not the lecture eight years.
-
00:08:08 So I have to delete this because by the devil tables get conflicting if I keep it.
-
00:08:18 Now the root will be lecture eight and it will be used in lecture eight.
-
00:08:26 So it will it's me suggestion as lectures 6 models namespace lecture 6 OK it will use
-
00:08:37 later eight model.
-
00:08:39 We also need lecture 8 weave.
-
00:08:48 Okay, and let's add index HTML you can also add lecture HPV as well.
-
00:08:54 I think I will name it as lecture age.
-
00:09:01 Okay.
-
00:09:02 So when I return we will I have to return later eight since it is not index.
-
00:09:15 And here also lecture eight and let's copy and paste binding here.
-
00:09:22 Okay.
-
00:09:24 We also need to set lecture eight model.
-
00:09:32 Okay here, okay, so everything is ready by default.
-
00:09:34 We should see lecture 8, so let's type a message here.
-
00:09:42 Lecture 8 index or let's say main page.
-
00:09:46 Let's make this Heather's.
-
00:09:49 h on and run the application to see
-
00:09:54 okay, it says that
-
00:10:30 we are passing an incorrect.
-
00:10:34 Item to maybe controllers.
-
00:10:40 Okay, where do we have an error?
-
00:11:00 It says that we have passed some early to late model, but Vash lecture 8 controller.
-
00:11:10 Lecture 8.
-
00:11:12 Okay update users.
-
00:11:14 So update users expecting lectures 7.
-
00:11:18 Oh, no, it is not.
-
00:11:22 Writing refresh model is the problem.
-
00:11:25 Perhaps that's right.
-
00:11:30 Yeah, here here is the problem because this is returning lecture 7 and our view is expecting
-
00:11:43 lecture 8 therefore.
-
00:11:45 We need to have additional refresh model.
-
00:11:55 Okay, how should we set it?
-
00:12:07 Yeah, I think we can make this perfect Dynamic with
-
00:12:12 No, it wouldn't be strong type of.
-
00:12:20 Let's add a in nature.
-
00:12:26 numbers
-
00:12:29 and here's
-
00:12:30 Okay, this is going to be a bit of a problem.
-
00:12:54 Yeah, let's duplicate this code we could all.
-
00:12:59 Register duplicate, but I think it doesn't worth it.
-
00:13:05 Okay, so this is the refresh model.
-
00:13:08 But since they have the same signature it will get conflicting.
-
00:13:11 So this will be a version SEC 8.
-
00:13:16 And here I will just called the version 8.
-
00:13:21 Okay now we should pop.
-
00:13:26 You see things you encounter a problem, you should read the details because usually details
-
00:13:40 will tell you where is the problem then you can pinpoint the problem easily and solve
-
00:13:45 it, okay?
-
00:13:46 So the error messages you are getting When developing A sulfate is really important,
-
00:13:52 okay?
-
00:13:53 So lecture 8 main page is open it but we are still seeing parameter names.
-
00:13:59 So now we are going to you
-
00:14:00 Us data on the teachers as known as also the model attributes.
-
00:14:04 Where do we set this attribute?
-
00:14:07 We set this attribute data annotation actually at model.
-
00:14:13 So let's open our model, which is lecture eight and I will set their first name as first
-
00:14:20 name.
-
00:14:22 okay, but you see it is displaying an error because it you it requires using system component
-
00:14:31 data in the tations reference and after it is added now we can add so the last name will
-
00:14:40 be s
-
00:14:42 Last name?
-
00:14:43 Okay.
-
00:14:44 So let's warm up a bit.
-
00:14:46 And now when we restart application we will see this display.
-
00:14:52 You see we also provide which item of The annotation display takes some parameters and
-
00:15:02 we are providing name.
-
00:15:04 You see this play attribute has probably multiple.
-
00:15:09 Options.
-
00:15:11 Okay.
-
00:15:12 First name and last name?
-
00:15:14 Yes much better.
-
00:15:16 Let's continue.
-
00:15:20 Notice how the data annotation just sits on top of the property just like any other type
-
00:15:25 of c-sharp custom attribute using the display data Association.
-
00:15:29 We can alter the display version of the property name with that in place.
-
00:15:34 Our property keeps its original name, but whenever it's presented to a user an alternate
-
00:15:39 version of first name is used.
-
00:15:42 types of data annotations
-
00:15:43 This was just an example of one of the many available data annotation attributes.
-
00:15:50 There are many more but a lot of them relates directly to validation a subject which will
-
00:15:55 be discussing in one of the next articles, but for a complete list of available annotation
-
00:16:00 attributes, I suggest that you check out the documentation.
-
00:16:03 What's that?
-
00:16:04 Let's take a look at the documentation.
-
00:16:07 Okay, currently it is displaying dotnet five.
-
00:16:12 So we are going to choose that net course.
-
00:16:15 make sure there's dotnet code 5, but if not the standard know,
-
00:16:22 Yeah.
-
00:16:23 Darkness 5 is the real need one?
-
00:16:28 Okay yesterday.
-
00:16:29 So what other annotations?
-
00:16:31 That are
-
00:16:32 so okay, there are so many annotations.
-
00:16:35 You see this virtual bit data time, attribute, customization credit cards.
-
00:16:39 Let's look at the display attribute.
-
00:16:43 And see what properties it has.
-
00:16:46 It has description.
-
00:16:48 Guess what?
-
00:16:49 That is used to display.
-
00:16:51 The description in the UI group name name.
-
00:16:58 Orders.
-
00:16:59 Interesting from
-
00:17:02 Resource, type short name.
-
00:17:05 Type ID.
-
00:17:07 Actually I will I want to check the description and see what kind of description attribute.
-
00:17:14 We can set.
-
00:17:15 So, okay, you see, when I put a coma, it is displaying all possible attributes that we
-
00:17:24 can set.
-
00:17:26 So I'm going to set the description as well.
-
00:17:30 We have set the name.
-
00:17:32 There is also older prompt.
-
00:17:34 Let's set the description equal to
-
00:17:36 Is and your first name to the text box?
-
00:17:47 Okay, and let's also set a prompt.
-
00:17:53 I wonder what does that?
-
00:17:57 Okay.
-
00:17:58 So this is this is the prompt message.
-
00:18:01 Okay.
-
00:18:02 Now when we restart application we can see what kind of HTML source code is generated.
-
00:18:11 This is just for the display attribution attribute.
-
00:18:16 There are also so many other attributes such as compared with our custom elevation data
-
00:18:20 type display column and editable attribute email address.
-
00:18:25 We will see many of them in the following lectures, but you can use all of them by just
-
00:18:34 looking here.
-
00:18:38 So I think I will add this source code like this.
-
00:18:51 I don't.
-
00:18:57 That's love.
-
00:19:03 Okay, so here's our page open it when I hover my mouse, I see nothing.
-
00:19:10 Let's check the source code.
-
00:19:12 Okay, there is space holder.
-
00:19:16 This is the prompt message.
-
00:19:19 However, placeholders would be displayed in the text box.
-
00:19:25 And what is and yeah.
-
00:19:29 So as we see where the description is nowhere to be found and the placeholder, this is the
-
00:19:37 prompt message.
-
00:19:40 So I think we can set prompt message for the text box.
-
00:19:47 Maybe here, but I'm not sure how we can do it.
-
00:19:58 It's okay.
-
00:20:06 If you ever need that, let's look.
-
00:20:15 Okay, there is no delay male NIV title.
-
00:20:35 Oh so you can display it like this?
-
00:20:49 okay, let's continue with our
-
00:20:53 story'll summary
-
00:20:56 data annotations allow you to enrich your models with metadata, which can be used for
-
00:21:00 a wide range of purposes by the MVC framework will talk about one of the most important
-
00:21:06 use cases for data annotations in the next article model validation.
-
00:21:10 Okay, let's go.
-
00:21:13 But before doing that I would like to.
-
00:21:19 Change this text box with attribute.
-
00:21:23 Okay, that is T model HTML attributes not stealing parts.
-
00:21:34 T model perhaps
-
00:21:43 Okay, there is expression string for months.
-
00:22:04 T-Mobile, that's
-
00:22:10 And we see text box from a treat.
-
00:22:16 Let's see.
-
00:22:20 Do they displace from the email?
-
00:22:31 move Smith
-
00:22:34 okay, so this is a very but I would like to use
-
00:22:45 front attributes that is description.
-
00:22:47 So this is the way we set so here I am setting it equal to
-
00:22:54 Last name whatever name but I think I can also set it to prompt attribute.
-
00:23:01 Perhaps, how can I do that?
-
00:23:06 Okay know what it's like that.
-
00:23:12 text area for input Fields text area for this text box for
-
00:23:29 Okay.
-
00:23:56 So probably we need to set.
-
00:23:58 Okay, tasting autoboot shocked having said that we need to set it as Nu T model.
-
00:24:15 No.
-
00:24:16 Nev, and
-
00:24:19 It is closed.
-
00:24:24 Okay, we don't need to close.
-
00:24:32 This placeholder and for this place so that I want to use the model.
-
00:24:47 Okay.
-
00:24:49 So, I have to set customer to the tears until your name.
-
00:25:02 And let's read on.
-
00:25:05 We could also set others attributes of text box in here, but I'm just setting placeholders.
-
00:25:16 Rocky, I see.
-
00:25:21 Okay.
-
00:25:22 Anyway, let's move to the next, okay.
-
00:25:35 And I'll take the 340b for located for why?
-
00:25:39 Why the fish all the different port?
-
00:25:45 Okay placeholder here.
-
00:25:46 But since it has a value that is overriding.
-
00:25:50 Yes, when we deleted body app, the placeholder works,
-
00:25:54 I see see the placeholder box then we delete the video.
-
00:25:59 Alright, so we will continue with model validation.
-
00:26:08 So modern, but it isn't.
-
00:26:13 model validation
-
00:26:15 in the previous article, we talked about data annotations and how they can enrich your models
-
00:26:20 to work even tighter together with your views.
-
00:26:23 However, a lot of the available data annotations are actually directly related to the validation
-
00:26:28 mechanisms found in the asp.net MVC framework.
-
00:26:31 They will allow you to enforce various kinds of rules for your properties, which will be
-
00:26:37 used in your views and in your controllers where you will be able to check whether a
-
00:26:41 certain model is valid in its current state or not.
-
00:26:44 EG after a
-
00:26:46 Submission.
-
00:26:47 So since this will also validate model at the server-side, it provides hundred percent
-
00:26:53 Security.
-
00:26:54 Even if the malicious user modifies, your HTML code and sense.
-
00:27:02 Unexpected values back to your server.
-
00:27:05 With model validation techniques of asp.net MVC framework, you will be secured, okay?
-
00:27:17 Adding basic validation.
-
00:27:20 Just like we saw in the previous article validation rules can be applied to properties through
-
00:27:24 the use of data annotations.
-
00:27:27 There are several types available.
-
00:27:29 But for now, we'll adjust a couple of them to the web user class previously introduced.
-
00:27:33 Okay, so let's apply some of them.
-
00:27:37 to our method
-
00:27:40 Well don't actually so we have display name.
-
00:27:45 We also adds required required means that this date specifies the data data data fields
-
00:27:52 required and it will be maximum by default.
-
00:27:57 We can also set I think Min and Max, how do we do that?
-
00:28:01 Maximum length Okay minimum length like this.
-
00:28:06 The minimum length equal to let's say three characters and maximum length will be 25.
-
00:28:15 So this will be a ploy to name method before even we can to post patch.
-
00:28:23 Let's try and if we don't answer anything
-
00:28:29 It won't post back to the server, of course the source code modification.
-
00:28:37 can cause a prospect but
-
00:28:41 when we do the model validation, it won't work.
-
00:28:48 Currently.
-
00:28:49 We are not doing any model validation.
-
00:28:53 So I will just show you example, okay, when I type something like this and click submit.
-
00:29:01 Okay says that.
-
00:29:05 oh multiple actions measured binding controller index and lecture controller index so
-
00:29:16 In The Binding controllers.
-
00:29:19 Yeah, I have to remove these as well.
-
00:29:25 That is why
-
00:29:28 Okay, let's let's start.
-
00:29:31 It was related to rotting that we have set in the previous lectures.
-
00:29:44 I'm not sure if this will ensure that I think it won't show error message here when I like
-
00:29:48 to do like this, let's just type something up meat
-
00:29:54 Yeah, it is not an enforcing any validation at the moment.
-
00:30:02 So it is just working right now.
-
00:30:04 So this is not we are not in enforcing a validation.
-
00:30:13 That's also at an email address as well.
-
00:30:17 so our model
-
00:30:18 here
-
00:30:21 I just think it's our email and this email will be also required an email address validation.
-
00:30:40 And I also will generate.
-
00:30:44 fields for email
-
00:30:51 Let's also set display name for email.
-
00:31:05 I think I will also set a prompt.
-
00:31:08 No, this is the postmark is not related.
-
00:31:14 Is this description guys.
-
00:31:18 Do we have placeholders?
-
00:31:24 No, let's try description.
-
00:31:30 Okay, email and let's continue.
-
00:31:36 Notice how the three properties have all been decorated with data, annotations giving the
-
00:31:45 framework useful information for validating the data.
-
00:31:49 First of all, all properties have been marked with the required attribute.
-
00:31:53 Meaning that a value is required.
-
00:31:54 It can't be null.
-
00:31:56 We have also used the string length, attribute to make requirements about the maximum.
-
00:32:00 And in one case, minimum length of the strings,
-
00:32:04 These are of course particularly relevant.
-
00:32:06 If your model corresponds to a database table where strings are often defined with a maximum
-
00:32:11 length for the last property.
-
00:32:14 We have used the email address attribute to ensure that the value provided looks like
-
00:32:18 an email address.
-
00:32:21 To test this example, let's create a simple form for it will use model binding as described
-
00:32:27 in a previous article to generate the fields for the properties.
-
00:32:31 Okay, if you have already done that no.
-
00:32:35 Now, we just need a controller to serve the view as well as handle the post request when
-
00:32:40 the form is submitted.
-
00:32:42 Let's just so there is the issue you see we have model state is valid.
-
00:32:52 We have to apply that and we are going to apply that rule into our action page where
-
00:33:00 we get the model.
-
00:33:02 So model state is what it since we are getting a model.
-
00:33:09 if it is invalid, we are going to
-
00:33:12 return a message.
-
00:33:18 like this and we will just return
-
00:33:20 so if it's in What it lets,
-
00:33:28 okay, make it like this.
-
00:33:32 And we will say that
-
00:33:36 so I can we see it in which we value is her nose
-
00:33:44 We will get to that.
-
00:33:48 The values you have entered are invalid.
-
00:33:52 Therefore please extend errors and try again.
-
00:33:56 So let's try
-
00:33:58 what we were unforeseen giver and thirsting a valid email address and name first name
-
00:34:08 with minimum letter 3 and maximum 25
-
00:34:15 Okay.
-
00:34:18 So since we have done updated the database it's coming as D. And when I submit okay,
-
00:34:30 it says the values here hundred are invalidated for free Kickstarter fund for example, I submit
-
00:34:36 ta and it won't update the database.
-
00:34:40 Yes.
-
00:34:41 However if I make it like this.
-
00:34:44 And enter a valid email.
-
00:34:48 It should submit.
-
00:34:51 Okay now update it.
-
00:34:52 However, we don't have email as our database.
-
00:34:57 So it is not getting updated.
-
00:35:00 Let's open our SQL Server profiler.
-
00:35:06 I will add email option and it will be notable column.
-
00:35:12 therefore when I do updates
-
00:35:18 it should work.
-
00:35:20 Oh, I also need to update my of course context I will do that as well.
-
00:35:30 So it will be also useful for you to remember how it was done.
-
00:35:41 So
-
00:35:42 No not as long.
-
00:35:48 Okay, and we see a father and we see here.
-
00:35:55 Janice design
-
00:36:01 and at emails I will make it unlock characters.
-
00:36:09 200 and it will be a loving nose Okay.
-
00:36:12 Therefore the existing users will get null value in the email address.
-
00:36:20 Like this.
-
00:36:21 Okay.
-
00:36:23 And then we need to update our model with equip.
-
00:36:27 Our Cool Tools reverse engineers and I, okay, I'm busy is selected.
-
00:36:34 Now currently loading database objects.
-
00:36:39 Okay, I will pick everything.
-
00:36:44 Yes, I will include connection string, okay?
-
00:36:51 Okay, it has generated email as well has max length and it should Allah also notable.
-
00:37:00 Let's do the command like this and then in my controller, I need to set.
-
00:37:14 Email equal to my model that has an email.
-
00:37:18 Okay, now emails will be also set gear current only updating user ID one.
-
00:37:25 So
-
00:37:27 If I want to update other users, I need to also add user ID.
-
00:37:30 Let's add that as well.
-
00:37:32 Okay, let's generate.
-
00:37:36 user ID
-
00:37:38 to be able to generate user ID.
-
00:37:43 I need to modify my model.
-
00:37:48 User ID actually this will be an integer.
-
00:37:57 I will set it as integer.
-
00:38:01 I unusual ID.
-
00:38:03 It will be required and let's set it as user ID.
-
00:38:14 Answer my game.
-
00:38:15 Okay, we can also set.
-
00:38:21 Requirement as integer perhaps with see if there's something like that.
-
00:38:28 Number no, mini--length, what other this and inch?
-
00:38:38 You should dance phone attributes because regular expression range attributes set range.
-
00:38:46 Yes.
-
00:38:47 It is double though.
-
00:38:48 It is not integers.
-
00:38:51 So they just wouldn't work.
-
00:38:58 What I said?
-
00:39:02 Yes.
-
00:39:03 when they sing it out, type
-
00:39:12 And stink.
-
00:39:13 My Strange all ops that.
-
00:39:22 I think I can be mean mocks, but I'm not sure.
-
00:39:28 Does customization as well?
-
00:39:36 No, probably we need to set range it is for double do I think.
-
00:39:51 We can set some Warriors as let's see there is minimum maximum.
-
00:39:58 Let's set the minimum as one maximum as in 32 Max.
-
00:40:03 Okay.
-
00:40:04 Let's set them here user ID text box for user ID for watching all this.
-
00:40:20 And that's the court behind.
-
00:40:24 We need to update.
-
00:40:28 By getting used right here.
-
00:40:30 So update user needs to update it.
-
00:40:38 Okay, because it wouldn't work with lecture 7.
-
00:40:45 Anyway, let's just update it.
-
00:40:49 So.
-
00:40:50 We have my user incoming it will use my user user ID.
-
00:40:54 Okay, and we'll touch email will be equal to
-
00:40:59 my user got email.
-
00:41:04 Okay, so did you make user ID primary K identity?
-
00:41:14 Let's check it out.
-
00:41:17 If it is identity.
-
00:41:20 Then we want your no it is not identity.
-
00:41:24 Therefore we can we should we need to also provide user ID as well.
-
00:41:29 Okay, everything is set here.
-
00:41:32 And okay, what we need to do is change refresh model.
-
00:41:38 So, where do we call this we call it?
-
00:41:42 I do we also need.
-
00:41:45 Set email here as well.
-
00:41:52 Here, so here we are providing one, but we will change this actually here.
-
00:42:01 This is the get method get watered can remain like this, but for post we need to provide
-
00:42:10 user ID from here's my model thoughts.
-
00:42:16 Usually also for get method.
-
00:42:21 I am going to get an integer like this.
-
00:42:25 A cold one on here.
-
00:42:31 So for this to be able to work,
-
00:42:39 We need to add.
-
00:42:42 optional parameters, perhaps
-
00:42:43 Is I'm not sure how can we get optional?
-
00:42:53 Yeah, we need to provide Full Pets.
-
00:42:59 jme, single of optional
-
00:43:12 is four parts.
-
00:43:23 Yeah, it should look like this so.
-
00:43:31 Let's try.
-
00:43:32 I think we should delete this and this really starts to see what happens.
-
00:43:50 And let's try update different users.
-
00:43:58 I think I will list users as table.
-
00:44:04 At the bottom.
-
00:44:05 Okay, it is working.
-
00:44:07 So let's try users to yes.
-
00:44:10 It is working.
-
00:44:11 However, we are not setting userid.
-
00:44:14 Therefore.
-
00:44:16 We need to set that and how we gonna set it from refresh model perhaps
-
00:44:22 Yeah, we need to set you right here.
-
00:44:26 Equal to user ID.
-
00:44:29 Yes, and we need to set.
-
00:44:33 Email as well.
-
00:44:36 Oh no, no need to set email and actually, let's just don't set these two.
-
00:44:49 Okay, now, which is Fork.
-
00:44:57 Okay, user ID 1 Let's Get You dried it to user ID to and the sketch user ID 3 user ID
-
00:45:22 3 Let's update an email for user ID 3.
-
00:45:25 Okay, when I refresh database there is nothing actually email is no and submit.
-
00:45:32 Okay.
-
00:45:33 So it says there is a page.
-
00:45:36 Okay, since we have changed our URL now we have to define the post as well.
-
00:45:44 so in the HTML begin form
-
00:45:47 we need to set post action.
-
00:45:55 how we were setting is
-
00:45:57 Okay, let's see.
-
00:46:03 maybe here
-
00:46:08 okay, there is action context.
-
00:46:14 Europe perhaps
-
00:46:17 No.
-
00:46:19 Action name?
-
00:46:23 Yeah, okay that is action name and it's for real.
-
00:46:34 Okay, so we need to think of someone.
-
00:46:40 It should be named.
-
00:46:45 I think we can just set it like this.
-
00:46:51 So that's provide full URL.
-
00:46:54 So the full URL will be lecture eight.
-
00:46:59 And what is our post?
-
00:47:04 So it's going to be indexed.
-
00:47:11 Yes.
-
00:47:13 Make sure 8 index action.
-
00:47:24 Let's try.
-
00:47:28 You see when you change the url that doesn't match to default you have to specify which
-
00:47:37 permit will be post.
-
00:47:38 Okay, pal.
-
00:47:40 Let's check this off meat and source code.
-
00:47:44 Okay, so it is going to post length hitting.
-
00:47:49 Okay.
-
00:47:50 It looks like incorrect.
-
00:47:54 Yeah, this action name is incorrect.
-
00:47:59 Let's try like this.
-
00:48:05 Yeah.
-
00:48:06 I'm not sure.
-
00:48:07 That's right.
-
00:48:09 So let's write for
-
00:48:12 Okay, they're not getting logos.
-
00:48:15 Interesting.
-
00:48:17 Why?
-
00:48:18 You are refreshed model.
-
00:48:23 Let's put a breakpoint here and yet page, okay.
-
00:48:34 okay, we are using oh, it will find values and because the user ID is
-
00:48:43 Kate is for why?
-
00:48:47 Or we don't have such user.
-
00:48:50 Okay?
-
00:48:51 Okay, let's continue.
-
00:48:53 So we have user 6, let's try that.
-
00:48:57 Okay this here.
-
00:49:00 Let's write update user six submits.
-
00:49:03 Okay, so this is not correct way.
-
00:49:10 Let's just fix it.
-
00:49:19 So this is the raining action.
-
00:49:28 Weekend for named action.
-
00:49:32 And it will be, of course not this one.
-
00:49:41 Tendonitis new action.
-
00:49:48 Okay, let's see.
-
00:49:55 Leave attached.
-
00:50:00 need directions
-
00:50:05 like this perhaps
-
00:50:13 if this would work.
-
00:51:05 Oh, we need to remove those with you.
-
00:51:35 Okay, so it didn't work this way.
-
00:51:55 So what is this not working?
-
00:52:05 And none of the answer / looking good.
-
00:52:22 Oh, we can also set action name.
-
00:52:35 So the first one is being the action name.
-
00:52:40 Yeah.
-
00:52:43 I think this is nice nice.
-
00:52:45 So here on our I think this is the nicest solution Rod.
-
00:52:53 I'm going to set action name as update model or let's say update will choose its model
-
00:53:04 whatever I can but whatever I want and in the action here, I will just provide a name
-
00:53:11 it will be there.
-
00:53:14 Actually simply like this.
-
00:53:23 I think rest will be handled by the.
-
00:53:27 Estimated enjoy.
-
00:53:30 We can also set form post method and such but it for Me by default.
-
00:53:49 Let's see.
-
00:53:55 Okay.
-
00:53:58 Thanks 16 this or something like this.
-
00:54:18 Okay, it doesn't looks correct to me.
-
00:54:38 Why?
-
00:54:41 It was looking good, but it didn't work.
-
00:55:04 My Moment
-
00:55:10 What can that other parameters as well?
-
00:55:30 Login and account.
-
00:55:39 phone controller index actions
-
00:55:41 HTML5 video for mere why is our team his not?
-
00:55:53 Working lectures age.
-
00:55:56 So the first one is
-
00:56:01 Action name and the second one is okay.
-
00:56:05 So now we are seeing four methods.
-
00:56:08 Let's see controller name action them.
-
00:56:12 Okay, now it should work and our action name will be
-
00:56:16 This one.
-
00:56:17 Yeah.
-
00:56:18 Yeah now make sense.
-
00:56:20 Now.
-
00:56:21 It will look for lecture 8 controller with the action name update lecture 8 modern.
-
00:56:27 Let's retry.
-
00:56:28 So this is the way we should have done that.
-
00:56:40 Okay, let's check the fiction.
-
00:56:56 Okay, now looks correct to me.
-
00:57:00 Let's retry like this.
-
00:57:02 Yes.
-
00:57:04 So now we can update let's update users.
-
00:57:07 Oh, by the way, since there is no user ID for I think you should insert it.
-
00:57:18 Okay.
-
00:57:22 Now this is working.
-
00:57:23 Let's check the database that were no user for and now it is here, next update, user
-
00:57:28 6.
-
00:57:31 You see the URL has returned back to the root because that is what we have done and user
-
00:57:38 6 at gmail.com.
-
00:57:42 What is also working?
-
00:57:44 Let's enter a non valid email and see what happens.
-
00:57:48 Okay.
-
00:57:49 Devotees you have answers are invalid.
-
00:57:51 Therefore please fix the errors and try again and it didn't get updated.
-
00:57:56 Okay, everything is working.
-
00:57:58 Now, we can continue to add sodium.
-
00:58:05 Okay, so let's continue to tutorial.
-
00:58:12 The interesting part here is of course, the post action where we check the is valid property
-
00:58:16 of the model State object.
-
00:58:19 Depending on the data you submitted in the form, it will be either true or false based
-
00:58:23 on the validation rules.
-
00:58:24 We defined for the model web user with this in place, you can now prevent a model from
-
00:58:30 being saved EG to a database unless it's completely valid.
-
00:58:35 Displaying validation errors.
-
00:58:37 Okay, this is what we need currently.
-
00:58:39 We are not displaying any error to the user.
-
00:58:42 Therefore, they cannot know what is wrong and this is something that I personally hate
-
00:58:49 from the applications when they don't show exactly what is wrong.
-
00:58:53 So you should always display what is wrong to the user?
-
00:58:57 Let's continue.
-
00:58:58 How can we do it easily?
-
00:59:01 In the above example, we can now see, whether a model is valid or not.
-
00:59:04 Thanks to the validation rules.
-
00:59:06 We have added to the model but it would obviously be way more useful if we could show these
-
00:59:11 problems to the end user so that they could be fixed.
-
00:59:15 Fortunately, for us, that's really easy.
-
00:59:19 First of all, we need to extend our form so that it can display error messages to the
-
00:59:23 user.
-
00:59:24 We can use another helper method found on the HTML object, the validation message for
-
00:59:29 method, it will simply output, the error message related to the field.
-
00:59:34 If there is 1, otherwise nothing will be outputted.
-
00:59:38 Here's the extended version of our form.
-
00:59:40 Okay, so simply we are adding HTML, validation message for two are for
-
00:59:50 For each attribute that we have and this will generate necessary HTML code automatically
-
01:00:00 for our application, which is extremely convenient to use.
-
01:00:05 Okay.
-
01:00:06 Let's restart application.
-
01:00:10 What's it now?
-
01:00:28 When we check the source code we will see what additional code edit.
-
01:00:50 Okay, so you see there is request verification token and let's check the HD bokeh.
-
01:00:56 There is email.
-
01:00:57 You see data World email.
-
01:00:59 The email field is not valid email address.
-
01:01:02 So this is the message that it has automatically added also.
-
01:01:06 There is another message.
-
01:01:07 So these are probably related to browsers and
-
01:01:10 Yeah, so it is also using spawn Crossfield validation.
-
01:01:18 And input yeah, I think it is using the browser features itself.
-
01:01:25 So when I submit like this, okay, it says that the email field is not valid email address.
-
01:01:31 You see we are seeing the error here.
-
01:01:35 And then we check other ones.
-
01:01:37 Okay, so there is also feels validation valid class.
-
01:01:43 And actually there is no validation for our this one.
-
01:01:48 Let's check this one.
-
01:01:50 Since they're both any validation, it didn't generate any think it's just like this and
-
01:01:56 then we check this long.
-
01:01:58 Okay, so it has ended input data while the interval length Okay data will liked Max state
-
01:02:06 of all length mean I think it is simply using
-
01:02:10 Browser features whatever the browser you are using why I can see the page source.
-
01:02:20 - I like this.
-
01:02:24 Okay.
-
01:02:25 Yes.
-
01:02:26 I don't see any secret.
-
01:02:28 So simply it is depending on the browser that you're using if your browser is not supporting
-
01:02:36 these features.
-
01:02:37 It wouldn't work.
-
01:02:40 Obviously.
-
01:02:41 For example, let's try submit.
-
01:02:43 Yes.
-
01:02:44 It says the image of some sort the messages also change different.
-
01:02:48 So this is saying the email field is required team.
-
01:02:51 If it is not valid the fields first name must be a string with minimum length 3 and maximum
-
01:02:58 length of 25.
-
01:03:00 Let's see if it's same here.
-
01:03:05 Yes, a Explorer older one Insanity explorers.
-
01:03:10 Which is not commonly used anymore.
-
01:03:13 Let's try.
-
01:03:14 Let's see if it is working or not.
-
01:03:17 Okay, let's try like this or it is still working.
-
01:03:27 So this one is also but this is not the oldest death.
-
01:03:31 This is not all those Internet Explorer.
-
01:03:34 This is the one that were still decent.
-
01:03:39 You see also there is data value d
-
01:03:42 Which is what we have set when I said like this, okay?
-
01:03:47 It says that the field user ID must be between 1 and intogen marks, okay?
-
01:03:53 Is working.
-
01:03:54 Now, we are also seeing error messages just next to the element, which is fun.
-
01:04:02 As you can see,
-
01:04:05 And it is extremely useful.
-
01:04:07 Extremely easy to implement.
-
01:04:10 Let's continue.
-
01:04:14 We also need to make sure that once the form is submitted and if there are validation errors,
-
01:04:18 we return the form to the user so that they can see and fix these errors.
-
01:04:24 We do that in our controller simply by returning the view and the current model state if there
-
01:04:28 are any validation errors, why do they it is important that you have to always check
-
01:04:36 this at the server side because without server side validation your abdication
-
01:04:43 We'll be vulnerable to every kind of attack.
-
01:04:49 With that in place, try submitting, the form with empty fields, you should be immediately
-
01:04:54 return to the form.
-
01:04:55 But with validation messages, next to each of the fields, thanks to the required, a trip.
-
01:05:04 Okay, let's test something.
-
01:05:05 Okay, the form submission is still happening.
-
01:05:09 We are not still preventing form submission but we are checking and displaying error messages.
-
01:05:21 If you try submitting the form with a value that doesn't meet the string length requirements.
-
01:05:25 You will notice that there are even automatically generated error messages for these as well.
-
01:05:30 For instance, if you submit the form with a last name, that's either too long or Too
-
01:05:34 Short you will get this message.
-
01:05:38 The field.
-
01:05:39 Last name must be a string with a minimum length of 3 and a maximum length of 50.
-
01:05:44 But what if you want more control of these messages, no problem.
-
01:05:48 They can be overridden directly in the data annotations of the model.
-
01:05:51 Here's a version of our model where we have applied, custom error messages.
-
01:05:56 Okay, you have what you would like to generate custom messages because in your language,
-
01:06:03 for example, for example, if you want, make this in Turkish,
-
01:06:08 We need to change messages as well.
-
01:06:12 So, okay, so we set required and now we can set error message of requires something like
-
01:06:21 this.
-
01:06:22 Let's try
-
01:06:24 so I will say that I will change it to anything.
-
01:06:27 I want you have to answer.
-
01:06:32 Valid email email can't be left empty.
-
01:06:41 Okay, or for example, let's add a message for range.
-
01:06:47 How can we say this I think from here.
-
01:06:53 confidence pool
-
01:06:55 Okay, there is error message like this equal to the answer it.
-
01:07:06 Volume was not valid.
-
01:07:11 Integers, for example, okay now let's retry.
-
01:07:25 By the way, I think this is also this will also accept double value is therefore we have
-
01:07:32 to enter something that is not what it as an integer.
-
01:07:36 Assume that you are displaying messages according to your visitor language than the it can be
-
01:07:49 also extremely easily done based on some parameters.
-
01:07:55 You can fit custom message here.
-
01:07:59 What do you have and you have to enter a valid email.
-
01:08:04 Okay, so this is the message.
-
01:08:05 We have answered, let's try something bigger than maximum integers.
-
01:08:09 Okay, do body is not valid for user ID.
-
01:08:16 Okay, so this is not the message we wanted.
-
01:08:24 Let's try something like this.
-
01:08:28 Okay, this is correct but this one is not.
-
01:08:34 Okay, so there are two different messages.
-
01:08:54 interesting
-
01:08:56 It is very different message based on the difference.
-
01:09:01 input
-
01:09:03 Anyway still we are seeing the errors.
-
01:09:11 And you are able to set custom messages.
-
01:09:17 You see for required requirements.
-
01:09:19 You can set this for email address.
-
01:09:22 You can set this you can set a savant.
-
01:09:27 So as you can see, it's really easy to customize the error messages.
-
01:09:33 displaying a validation summary
-
01:09:34 An individual error message for each input field can be really useful especially if you
-
01:09:41 have a large form.
-
01:09:43 However for smaller forms like the one in our example, it might be more useful to Simply
-
01:09:47 display a summary of the validation errors either above or below all the fields that's
-
01:09:53 easily accomplished.
-
01:09:54 Thanks to the validation summary method found on the HTML helper object.
-
01:09:59 Okay, let's also print a summary and see what kind of output it generates.
-
01:10:06 I am going to put it under the input.
-
01:10:11 Like this.
-
01:10:14 And see what kind of validation summary output we will get.
-
01:10:20 We will still get individual with messages since we didn't remove them.
-
01:10:26 And we will get a summary as well.
-
01:10:32 However, this playing ball to might be more useful because with individual messages, they
-
01:10:41 would, they will be sure that what is wrong for, which filled with somebody, it will display
-
01:10:46 everything at the bottom.
-
01:10:48 Okay?
-
01:10:49 So this is our summary.
-
01:10:51 You have to enter a valid email.
-
01:10:52 That can email can't be left.
-
01:10:55 Empty.
-
01:10:56 It is the same as here.
-
01:10:59 Okay so it's just now let's enter zero.
-
01:11:06 Okay?
-
01:11:07 It's added less answers like this.
-
01:11:09 Okay so this is the summary and these are the individual error messages.
-
01:11:14 It is working great.
-
01:11:18 Okay.
-
01:11:19 Okay, so let's continue summary.
-
01:11:26 Adding basic model.
-
01:11:27 Validation is very easy and will help ensure that user provided information.
-
01:11:31 Matches the requirements you may have for the data as mentioned, these are just some
-
01:11:36 of the validation options available in the asp.net MVC framework in the next article
-
01:11:42 will look into the rest of them.
-
01:11:44 Okay, let's move to the next article.
-
01:11:56 okay types of model validation data on annotations
-
01:12:03 types of model validation data annotations
-
01:12:07 in the last article, we introduced model validation and showed you how easy it is to get started
-
01:12:12 with we used a couple of the validation related data annotations like required and string
-
01:12:18 length.
-
01:12:19 But as mentioned there are several other types in this article.
-
01:12:23 I will run through all of them to give you a better idea of all the possibilities.
-
01:12:28 required
-
01:12:31 specifies that a value needs to be provided for this property.
-
01:12:34 You should be aware that non nullable value types EG integers and Day times are always
-
01:12:40 required.
-
01:12:41 And therefore you don't need to add the required attribute for them for Strings.
-
01:12:45 You should have in mind that an empty value will be treated like a null value and therefore
-
01:12:49 result in a validation error.
-
01:12:52 This Behavior can be changed by using the allow empty strings property though.
-
01:12:56 Okay, that's why with all the things property.
-
01:12:59 and in our model,
-
01:13:06 Here, I will set the last name as required.
-
01:13:14 However, I will allow you see, it is also displaying that features allow them to string.
-
01:13:22 It's a bull validation
-
01:13:24 equal to,
-
01:13:29 Sure.
-
01:13:32 Now it will be required but it will allow empty strings empty string is simply space
-
01:13:41 characters.
-
01:13:42 Okay let's retry.
-
01:13:45 What do we have seen the string length?
-
01:13:55 string length
-
01:14:01 allows you to specify at least a maximum amount of characters the first non optional parameter
-
01:14:06 for a string with the added possibility of specifying a minimum amount as well.
-
01:14:11 Here's an example.
-
01:14:14 string length, 50 minimum length equals three
-
01:14:16 In this case the value can't be validated if it's less than three characters or more
-
01:14:22 than 50 characters long.
-
01:14:24 Okay.
-
01:14:26 So first let's try our last name.
-
01:14:28 I will delete it submit or two.
-
01:14:30 It says the last name field is required.
-
01:14:33 Now, I will test with a space character like this submit or we are still gained getting
-
01:14:40 an error.
-
01:14:41 Okay.
-
01:14:42 Let's see.
-
01:14:43 We have 42 lost the Emir and we have a
-
01:14:48 loads empty strings
-
01:14:50 Let's try again.
-
01:14:52 Trusting this why something like this?
-
01:15:00 Okay, it's it is supposed to allow empty characters, but
-
01:15:16 Yeah, it is not working.
-
01:15:24 Still not unloving.
-
01:15:28 No.
-
01:15:31 let's see if
-
01:15:41 Also, ask it.
-
01:16:07 Oh, I see.
-
01:16:36 We also need to set this as well.
-
01:16:39 It is not very important.
-
01:16:49 Let's continue.
-
01:16:52 Okay, there is range.
-
01:17:00 range
-
01:17:02 With the range attribute, you can specify a minimum and a maximum value for a numeric
-
01:17:07 property and Float double Etc.
-
01:17:09 Both a minimum and a maximum is required when you use this attribute like this.
-
01:17:16 range 1/100
-
01:17:19 now your numeric value must be between 1 and 100.
-
01:17:24 compare
-
01:17:26 the compare attribute allows you to set up a comparison between the property in question
-
01:17:31 and another property requiring them to match a common use case for this could be to ensure
-
01:17:36 that the user enters the same values in both the email and the email repeated fields.
-
01:17:43 Compare mail address repeated public string mail address get set public string mail address
-
01:17:48 repeated get set.
-
01:17:50 Okay.
-
01:17:51 So for this to work, we need to add additional parameter to our model, but it won't be used
-
01:18:02 when saving or updating database.
-
01:18:09 simply it will be like
-
01:18:12 you will repeat it.
-
01:18:16 Like this and then we are going to generate additional image parameter.
-
01:18:27 You may need repeated like this and additionally.
-
01:18:34 Here we are going to add a compare.
-
01:18:41 Which Compares it will take other property.
-
01:18:45 The other property will be
-
01:18:48 Email repeated.
-
01:18:49 But is expecting a string?
-
01:18:54 Yes.
-
01:18:55 Yeah, let's try.
-
01:18:58 If it will work or not.
-
01:19:21 Okay, we have email repeated in the same div.
-
01:19:34 So I like this.
-
01:19:36 Okay email and is our limited it repeated.
-
01:19:40 Do not match.
-
01:19:41 Yes, now we are getting the error message.
-
01:19:45 It is displayed here.
-
01:19:46 We can set variable.
-
01:19:48 We want the message to be displayed.
-
01:19:50 For example.
-
01:19:52 I can set the validation message inside same D, but but with
-
01:20:03 BR.
-
01:20:05 I mean the NIV line like this.
-
01:20:10 Why?
-
01:20:12 It's not working?
-
01:20:17 Like this.
-
01:20:18 And now the new message will be here.
-
01:20:21 I can also change how it looks, for example, let's do that as well.
-
01:20:29 can let single
-
01:20:37 spawn
-
01:20:40 like this and
-
01:20:48 get some starting Style.
-
01:20:50 Okay, here's let's set font colors of let's see just the background color.
-
01:21:01 For example.
-
01:21:05 The crumbs.
-
01:21:06 Okay.
-
01:21:07 Polish
-
01:21:08 This whatever the color B wants.
-
01:21:12 For example, blue, violet.
-
01:21:15 Okay.
-
01:21:16 And now the message of error, message of email will be displayed under the text boxes.
-
01:21:25 With a background of a background color of blue.
-
01:21:30 Violet,
-
01:21:31 And there are also specific types.
-
01:21:39 I will also test them.
-
01:21:45 I said, I kiss, okay?
-
01:21:48 The image field is not a valid email address.
-
01:21:52 So I have to add a valid email first.
-
01:21:55 Then.
-
01:21:56 Okay, email an SRE made repeated to not match.
-
01:22:02 Okay, let's continue.
-
01:22:04 So that is also specific types.
-
01:22:11 Specific types.
-
01:22:12 If your string falls into a specific category eg a phone number the asp.net MVC can supply
-
01:22:19 you with basic validation out of the box.
-
01:22:22 Here's a list of the types you can specify.
-
01:22:26 Credit card validates that the property has a credit card format.
-
01:22:29 Okay.
-
01:22:30 So for example credit card, how can we do it?
-
01:22:34 Let's generate another div.
-
01:22:36 And let's look for HTML.
-
01:22:52 If there's any credit card, check box.
-
01:23:03 Okay.
-
01:23:05 Okay, metadata, provider temp data.
-
01:23:14 You are having quarters.
-
01:23:21 Editor for mods.
-
01:23:24 ID label listbox, passports radio button.
-
01:23:27 Textarea text box.
-
01:23:29 I think it was done with a special format.
-
01:23:35 So let me find it.
-
01:23:39 Okay, it's going to be me.
-
01:23:45 See
-
01:23:46 Okay, text box for credit cost, okay?
-
01:24:02 Google student name Modern Age
-
01:24:35 editor for and
-
01:24:43 maybe we need to use editor for I'm not shoes for credit cards.
-
01:24:56 and see if there is
-
01:24:59 such for months.
-
01:25:05 Okay, so now I am looking for something automatic.
-
01:25:19 This is that than MVC automatic.
-
01:25:40 Okay, so datatype, okay, there is data type.
-
01:26:12 and
-
01:26:13 today before textbox forth.
-
01:26:23 Html text box for credit cards.
-
01:26:27 Maybe there is some solution.
-
01:26:30 Okay, so probably going to help us.
-
01:26:42 What's the text box?
-
01:26:47 What you saw time.
-
01:27:17 What time?
-
01:27:36 So probably beat pattern.
-
01:27:38 We can achieve that.
-
01:27:42 Can I stay?
-
01:27:46 text box for
-
01:27:48 and then there is this thing for months.
-
01:27:56 Okay.
-
01:28:01 Hey, I couldn't find right now if I search for the I can.
-
01:28:56 But I will just pass it so you can validate property email address.
-
01:29:13 Yes.
-
01:29:17 Common for all of these is that they only provide a very basic validation.
-
01:29:21 So for instance, the email validation will only ensure that the entered value will contain
-
01:29:26 some of the characteristics of an email address like containing an IT character and so on
-
01:29:31 but it will still be possible to enter something that is not actually an email address for
-
01:29:36 more accuracy in or flexibility.
-
01:29:38 Use the regular expression attribute or Implement your own custom logic as described in one
-
01:29:44 of the next articles.
-
01:29:46 regular expression
-
01:29:49 when none of the other types of validation are flexible enough The Last Resort might
-
01:29:53 very well be the regular expression attribute.
-
01:29:57 It allows you to specify a regular expression which the value of your property will be validated
-
01:30:02 against and it will only be valid if there's a match regular expressions are way too big
-
01:30:07 a subject to handle in this article, but allow me to demonstrate just how powerful they are.
-
01:30:12 Anyway, imagine that your web user class has a member ID, which has to be in this specific
-
01:30:18 format.
-
01:30:19 20 - 0 0 0 0 - 0 0 0 0
-
01:30:24 or in other words two letters a dash and then two groups of four numbers with a dash between
-
01:30:30 like ZX 1234 5678.
-
01:30:34 We can make a regular expression for just that and put it inside our regular expression
-
01:30:39 attribute.
-
01:30:41 Regular expression a Z2.
-
01:30:43 Okay.
-
01:30:44 So regular expressions are of course another topic, but you can use regular Expressions
-
01:30:49 as well for validation.
-
01:30:51 This can be done for credit card or any other think the possibilities with regular expressions
-
01:30:57 are of course and this the possibilities with regular expressions are almost endless and
-
01:31:03 they can be used in many other situations than just validation.
-
01:31:07 So learning how to use them can be a good investment.
-
01:31:09 Definitely very good.
-
01:31:11 Investment, you should learn them if you can they are hard but extremely useful in many
-
01:31:16 cases investment.
-
01:31:19 Here's a couple of links.
-
01:31:20 If you want to get started learning regular Expressions reg ex tutorial and cheat sheet
-
01:31:25 / reg ex interactive tutorial then also this pages.
-
01:31:28 I think we will see them.
-
01:31:31 Okay, there's a tutorial here and there is another one.
-
01:31:39 You can type your pattern.
-
01:31:41 For example, let's type our pattern.
-
01:31:47 Okay.
-
01:31:49 Oh, here we have.
-
01:31:51 The type pattern that will match this
-
01:31:55 So maybe like this, yeah, it is matching old.
-
01:32:03 Okay.
-
01:32:05 Okay.
-
01:32:06 Usually, it's matching all three character and renovate Force design fails.
-
01:32:17 Like this you can do is I'm not.
-
01:32:18 I also don't.
-
01:32:19 I am not also very good fit regular expressions.
-
01:32:23 Therefore I can show you and I can show you another.
-
01:32:31 Expect examples.
-
01:32:33 But there are also some less notes here.
-
01:32:38 So I think it would be three and six or seven years, minimum three maximum six.
-
01:32:46 You could also set.
-
01:32:49 Characters such as like this yes to matching.
-
01:32:59 What light is it was Phil here?
-
01:33:01 Very good, very good website actually to learn regular expressions.
-
01:33:04 Okay, so let's move to the next.
-
01:33:10 custom model validation
-
01:33:14 custom model validation
-
01:33:25 If you ever feel that the built-in validation methods as discussed in the previous articles
-
01:33:30 are not enough asp.net MVC, offers you the possibility of implementing your own validation
-
01:33:36 logic.
-
01:33:37 There may be many occasions where this is a good idea.
-
01:33:40 But you should have course first make sure that there isn't already an easier built,
-
01:33:43 an alternative, like the regular expression option which offers great flexibility.
-
01:33:50 With that said, it's really not that difficult to implement your own validation logic.
-
01:33:54 There are a couple of ways to do it, so let's examine both will expand on our previous examples
-
01:34:01 in the last couple of Articles where we introduce the web user class, will add a birthday property
-
01:34:07 to it and then do some custom validation of it.
-
01:34:11 Custom validation, with validation, attribute.
-
01:34:14 If you want validation similar to the built-in kind, where you can add data annotations to
-
01:34:19 your properties, EG required or email address.
-
01:34:23 You can simply create a class and let it inherit from the validation attribute after that simply
-
01:34:28 override the is valid method and write your own logic.
-
01:34:33 For example, I have added some pretty basic and perhaps slightly silly validation to the
-
01:34:38 is valid method just to show you the possibilities.
-
01:34:42 Some of it could have been handled with range validation but not all of it.
-
01:34:46 And that's the beauty of custom validation.
-
01:34:48 You can add as much logic as you need to.
-
01:34:51 Also you can return individual error messages for each of your checks like I do in my example.
-
01:34:58 Okay.
-
01:34:59 So this is a great example of doing custom, validation assume that we also have birthday
-
01:35:08 parameter as well.
-
01:35:13 So let's add Portage of database.
-
01:35:15 And it's for the day time.
-
01:35:20 We will all love news.
-
01:35:23 And then just update hour.
-
01:35:28 model
-
01:35:29 Okay.
-
01:35:30 So the word table come.
-
01:35:38 Let's see the birthday where it is email birthday here has column type date time and then in
-
01:35:49 our model here, I'm going to add row daytime kedt birthday.
-
01:35:59 Okay, I could use validation for birthday something like this.
-
01:36:07 Daytime, of course, not my birthday you guys the daytime validation or date?
-
01:36:18 beta type thoughts
-
01:36:20 Why are you see the options?
-
01:36:29 data type
-
01:36:33 Okay.
-
01:36:34 There was a list of all the nations.
-
01:36:42 Let's check them.
-
01:36:46 It was in the previous long, I think.
-
01:36:51 Let's check from our source code.
-
01:36:54 Yes.
-
01:36:55 Let's open it.
-
01:36:56 What kind of data annotations we have?
-
01:36:59 And here we have credit card attributes?
-
01:37:03 for example
-
01:37:04 And I think I will check the data type.
-
01:37:10 Okay, there is data type.
-
01:37:12 And from data type we have credit card currency custom date data.
-
01:37:18 Yes.
-
01:37:19 So this is the one that we need.
-
01:37:24 And there is an example also of here.
-
01:37:27 Here how we apply it so I could just apply.
-
01:37:34 Datatype requirements and date stamp email, address date, they time actually so this will
-
01:37:44 ensure that the entered address entered value is daytime.
-
01:37:51 However, I want to extend this.
-
01:37:54 For example, I don't want to allow
-
01:37:59 Dates previous or after than certain date.
-
01:38:03 Therefore, I will write an extended validation class, something like this, public class of
-
01:38:09 metals.
-
01:38:10 Let's see.
-
01:38:13 Yes, plus my custom the birds.
-
01:38:20 they
-
01:38:22 validation and it will extend data validation.
-
01:38:26 Which it is what addition a trivet?
-
01:38:31 Yeah.
-
01:38:32 So this is a Classic Stage class inheritance actually not extension.
-
01:38:37 So this is this class would inherit everything that validation attribute class.
-
01:38:43 Have you see it is coming from here.
-
01:38:46 Then I'm going to have protected over, right?
-
01:38:51 So this is going to overwrite validation result is valid method is valid method is called
-
01:38:58 van.
-
01:38:59 It is called, when we check in our controller model, state is valid, and here we will check
-
01:39:07 whether it is valid birthday or not.
-
01:39:10 First, we should check actually weather until its value.
-
01:39:14 Is
-
01:39:16 Daytime so first we need to add a time like this and then we will be sure that it is daytime
-
01:39:24 and we will check the internet dates something like that.
-
01:39:30 Okay, and there are some validation results because we are going to add our custom validation
-
01:39:38 to here simply simply like this.
-
01:39:43 Okay, then we are going to have another division to hear it will be less copy paste this.
-
01:39:58 level four
-
01:40:02 TT birthday and I think there is a way to
-
01:40:10 date picker or something
-
01:40:12 But I don't remember.
-
01:40:18 How was it.
-
01:40:23 Maybe it is shown here.
-
01:40:24 okay, it is still text box for
-
01:40:28 I think it was in the next articles.
-
01:40:32 Maybe he will talk how much?
-
01:40:40 external input
-
01:40:50 so this is the topic of next lecture Bart.
-
01:41:02 little video input
-
01:41:16 Yeah.
-
01:41:20 Just so.
-
01:41:30 text box for
-
01:41:31 If someone has already asked in there is more than me live type date.
-
01:41:43 Yeah, this is what we need.
-
01:41:46 And here we will Define the type as date and validation message will be 4 DT port a we
-
01:41:55 won't be saving them in the day in the database yet because we didn't update our functions,
-
01:42:01 but we should be able to see custom validation.
-
01:42:07 there
-
01:42:09 I think we can even do a debug.
-
01:42:16 It's here.
-
01:42:18 Okay, where did he cordage?
-
01:42:24 We have coat it in our model.
-
01:42:26 I think we should even test it here.
-
01:42:32 Okay first I will enter an invalid state or UC it date format.
-
01:42:38 This format is coming from browser.
-
01:42:41 So it will look different on each roses.
-
01:42:47 Let's see.
-
01:42:50 Okay, you see there is the econ is different.
-
01:42:56 Not much much different.
-
01:42:58 So it should allow us to pick some date.
-
01:43:01 Let me enter an invalid.
-
01:43:04 It doesn't allow me to.
-
01:43:07 Change I will make it invalid from here something artist.
-
01:43:13 It is not working.
-
01:43:16 Okay, I have changed the date volume.
-
01:43:24 Let's dress up meat and see what happens.
-
01:43:28 Okay, it has come to here's the volume or it will send the money that we modified.
-
01:43:41 interesting why I want to change the value here and Sons
-
01:43:47 Oh now the value is invalid.
-
01:43:51 Okay.
-
01:43:52 So you see it is verifying the value therefore we didn't get into this.
-
01:43:59 Why because we are verifying the value is daytime or not in here.
-
01:44:03 However, if I remove this when I enter in what its value I should get into my methods.
-
01:44:13 Let's see, so it's provides an extra layer of security.
-
01:44:18 First we take that whether it is a holiday time and value input.
-
01:44:23 Then we check whether it satisfies or custom rules or not.
-
01:44:32 Let's see.
-
01:44:34 Okay.
-
01:44:36 Now I will change earlier to something invalid.
-
01:44:43 So it is the default value is almost two years and then I submit
-
01:44:49 The body is in one it.
-
01:44:54 How it is able to check that.
-
01:45:10 input validation earners
-
01:45:17 So it is not getting into here.
-
01:45:23 interesting
-
01:45:26 operation exception not implemented exception.
-
01:45:38 Maybe it is checking that it is whether daytime or not since this is daytime type.
-
01:45:48 I'm not sure.
-
01:45:50 And we submit like lucky we have to provide something.
-
01:45:55 Okay.
-
01:45:56 No, I'm just looking.
-
01:46:00 Yeah.
-
01:46:01 Okay, so it says you are too young but why because we are checking that if the birthday
-
01:46:08 year is about 2,000 they are just too young.
-
01:46:13 Let's also update our model so they will be saved in a database.
-
01:46:21 We table T equals V are used to create birthday.
-
01:46:30 and then,
-
01:46:34 You cannot implicitly convert system, daytime okay.
-
01:46:42 It is not able to convert because we are loved.
-
01:46:48 Nobody else.
-
01:46:50 therefore, we have to check whether if it is not me if
-
01:46:57 no.
-
01:46:59 We have to explicitly convert it.
-
01:47:08 this okay and
-
01:47:10 Rachel database mode
-
01:47:15 Okay, let's set it like this.
-
01:47:23 Yes, we need to set the email as well.
-
01:47:29 I mean the port a
-
01:47:40 Okay.
-
01:47:42 So this is update users.
-
01:47:45 Okay let's try and let's see the users.
-
01:47:53 Okay.
-
01:47:54 Birthday values are known actually this is database null.
-
01:47:56 So I'm not sure if it will work or not as a new church because normally they time cannot
-
01:48:03 be known because it is a struct type.
-
01:48:15 So tell me shoes, we just need to set a breakpoint here.
-
01:48:20 When we refresh model, we will see.
-
01:48:25 So let's refresh.
-
01:48:27 So the birthday, okay, it is not therefore, it should work.
-
01:48:31 You're working and let's update this user.
-
01:48:36 Got something valid.
-
01:48:39 2005, February 15th, I think it is.
-
01:48:50 Okay, now it's not satisfying so we need to change it to.
-
01:48:58 something like,
-
01:49:00 Like this.
-
01:49:02 Okay now it should work.
-
01:49:06 Let's enter a valid email to, okay, so it says it is updated and when we refresh it
-
01:49:15 is not getting it reads.
-
01:49:19 Okay.
-
01:49:20 Okay, just it didn't work.
-
01:49:25 Why?
-
01:49:26 We have an error somewhere.
-
01:49:33 Oh, I know the reason because we didn't that it's here.
-
01:49:38 We also have said that here is equal to
-
01:49:43 my model.
-
01:49:45 ET port a and now which is work.
-
01:50:11 Okay, aunt.
-
01:50:31 You see email was updated for I can see it.
-
01:50:34 Let's update.
-
01:50:36 Forte as well
-
01:50:38 Okay now take it and let's refresh it is not rich, but it is updated.
-
01:50:48 Okay, so the birthday is updated but it is not displayed here.
-
01:50:54 I wonder if you can display the data Bots.
-
01:51:00 Probably we can't load it.
-
01:51:04 Yeah, it is strongly coming from database but not getting loaded into here.
-
01:51:11 Okay, actually the body is set but it is not displayed.
-
01:51:21 What kind of Hollywood we get this place?
-
01:51:23 Maybe let's pick something.
-
01:51:29 Okay, why I don't see nobody.
-
01:51:41 changing interesting
-
01:51:42 It is selling summer and volume, but I don't see it in the source code.
-
01:51:56 So this value is kept somewhere else.
-
01:52:12 What blush?
-
01:52:22 Okay, it shows there is flex.
-
01:52:51 What is this?
-
01:52:54 Tennessee
-
01:52:55 Okay, so
-
01:52:57 type date
-
01:52:59 so it is expecting a day something like this.
-
01:53:04 We need to change the value of date actually.
-
01:53:14 Let me see.
-
01:53:20 So I simply need to promote the value like this year month date.
-
01:53:27 So I will fix it in a moment in my controller refresh.
-
01:53:32 So where is the refresh?
-
01:53:34 Okay, so the fish is here.
-
01:53:40 Let's go - and then we'll each email.
-
01:53:43 We are going to format.
-
01:53:45 It's specific to something.
-
01:53:50 Okay, try for mode or
-
01:53:54 to sit drink
-
01:53:57 Yeah, here.
-
01:53:59 And
-
01:54:00 See, chop, date-time format to sync and see how can we do it?
-
01:54:09 Okay, simply like this.
-
01:54:12 Okay, what we need is years moment and date.
-
01:54:21 Let's open it.
-
01:54:27 I think it will be something like this years.
-
01:54:35 So we don't have this moons date today.
-
01:54:41 And oh, I can send it like that.
-
01:54:44 So I have to set a sitting to eat value.
-
01:54:52 So
-
01:54:56 hope to be able to set its value.
-
01:55:02 I think that is also something.
-
01:55:05 But, you know, something,
-
01:55:17 Okay, there is new volume.
-
01:55:28 So we need to set.
-
01:55:30 when you equal to,
-
01:55:36 Yeah, and it's for me.
-
01:55:44 Toasting on.
-
01:55:48 It is not available peers.
-
01:55:57 So how can we set a dynamic volume?
-
01:56:06 Model H. Okay, so now this makes sense it when we model.
-
01:56:12 Yeah, it's TT birthday to Citrine.
-
01:56:15 Yes, simply like this.
-
01:56:17 So you sure.
-
01:56:19 Okay, shows year four digits or nice, then mode 2 digits nice and they
-
01:56:29 They have to want to watch it.
-
01:56:34 Also.
-
01:56:35 I didn't know this was available.
-
01:56:37 So you see how intelligence is advances recently.
-
01:56:41 It will be simply like this now.
-
01:56:46 It should work.
-
01:56:48 Let's test it
-
01:57:09 Okay, and it is still not.
-
01:57:34 loaded by
-
01:57:36 Okay, so the value is not set.
-
01:57:42 I think
-
01:57:44 this requires a bigger string like this.
-
01:57:50 I'm not sure or maybe it.
-
01:57:56 Let me see.
-
01:57:59 Yeah, it is expecting something like this.
-
01:58:02 Yeah, this is our mistake.
-
01:58:06 That's where I start.
-
01:58:09 It's maybe also case sensitive, but I'm not sure about that.
-
01:58:20 CinemaSins boy.
-
01:58:34 Maybe it's a surprise lowercase, let's try that way.
-
01:59:03 They still mad at you.
-
01:59:16 Can you mean max type name volume?
-
01:59:34 Okay.
-
01:59:37 expecting this
-
01:59:42 okay.
-
01:59:45 So it is case sensitive according to this answer.
-
01:59:48 We can set type ID name whatever we want and value itself.
-
01:59:56 Let's see what it's all for naught.
-
02:00:07 She's still not working.
-
02:00:17 Why?
-
02:00:18 We are setting volume differently but it is not.
-
02:00:32 Watching.
-
02:00:36 What can I say?
-
02:00:42 Okay.
-
02:00:44 According to the answer here we need to set at character as well and it is also case sensitive.
-
02:00:57 So let's retry.
-
02:01:04 It's still not working.
-
02:01:33 This is so annoying.
-
02:01:36 Cuz whatever we do we are not able to set.
-
02:01:41 volume of this
-
02:02:03 Martin horse
-
02:02:42 Everybody to different cities seriously everybody just different.
-
02:03:27 Says like this in heels.
-
02:03:33 Let's remove the type.
-
02:03:36 And try like this.
-
02:03:37 Let's see what it put out for sure.
-
02:03:39 If this work done, we can move from on here.
-
02:03:51 maybe it is because the browser is not able to handle that in the source, you can also
-
02:04:14 see
-
02:04:15 Yeah, well you is not getting here.
-
02:04:45 No matter what we do.
-
02:05:31 It is interesting.
-
02:05:32 The body are not working.
-
02:05:53 Let's try like this.
-
02:06:15 Okay, it is this book either.
-
02:06:21 this
-
02:06:22 You're not working either nothing works.
-
02:06:24 Seriously, nobody will be said is not working and it is extremely annoying.
-
02:06:37 I don't know why.
-
02:06:59 Just so it's saying that this and this is being different.
-
02:07:04 But these two are same so this is same with this but none of them works.
-
02:07:14 Why why why why God?
-
02:07:18 both method is not working evil Anonymous type
-
02:08:04 Okay, so this also editor for us.
-
02:08:27 If the property your bindings has a value of IC, so there is no way of changing this.
-
02:08:45 I see.
-
02:09:01 So Lonely by and we are not able to change
-
02:09:06 It's volume.
-
02:09:19 Okay.
-
02:09:32 Okay.
-
02:09:45 Someone else also ask if this
-
02:09:53 They have fixed it with jQuery.
-
02:09:57 Oh, there is display format maybe this can work for us.
-
02:10:11 Yeah.
-
02:10:18 I think this can be even better.
-
02:10:22 But we also need to set a date.
-
02:10:28 Something like this.
-
02:10:35 Yeah.
-
02:10:37 Type date in our model.
-
02:10:46 Here's
-
02:10:48 I'm going to change the display format as
-
02:11:08 daytime
-
02:11:14 no.
-
02:11:19 Is not working.
-
02:12:09 interesting
-
02:12:34 What is work?
-
02:12:38 No, this is not working.
-
02:12:54 We have tested this.
-
02:13:25 Want a soda?
-
02:13:31 Yes, we can set format as well.
-
02:14:03 let's not let me Zoom the first and
-
02:14:57 No still not working.
-
02:15:00 anyways
-
02:15:01 I will call some find a solution.
-
02:15:06 Okay, I have noticed that we have a very small error that is why it didn't work.
-
02:15:14 Last time.
-
02:15:15 You see it is expecting this type of input because according to I say all 8601.
-
02:15:28 This is the format therefore after I have changed the format like this now.
-
02:15:35 It is working.
-
02:15:37 Let me show okay, we have edit refresh and see the date is here.
-
02:15:44 So that's also said it another date like this and submit.
-
02:15:49 Okay, it doesn't accept December according to our custom verification.
-
02:16:00 Okay now updated when I refresh you will see date is also being this late.
-
02:16:05 Okay, everything is
-
02:16:08 Looking totally as expected and let's open our tutorial.
-
02:16:17 Okay verification is success.
-
02:16:20 Okay, here we are resolve violation success.
-
02:16:32 Okay, and
-
02:16:34 okay, I think I will end the lecture here so we can continue from Custom validation
-
02:16:46 object.
-
02:16:47 It will be also good for us that because we will remember but we were the previous week.
-
02:16:56 So let's take the lecture notes.
-
02:17:00 Okay, we are left with here.
-
02:17:12 Okay, let's see it this part as well.
-
02:17:28 Congratulations, you have now implemented custom validation Logic for one of your properties.
-
02:17:35 One of the really cool benefits of this approach is that your validation logic isn't necessarily
-
02:17:40 tied to a specific model instead of calling your class web user birthday validation a
-
02:17:45 tribute.
-
02:17:46 You could have just called it birthday validation attribute and reused it across all types of
-
02:17:49 birthday related properties in your project on the other hand.
-
02:17:54 You will run into situations where it makes perfect sense to tie your validation logic
-
02:17:58 to your model will see how that works in the next section of this article, okay?
-
02:18:04 So we are simply validating.
-
02:18:10 as we wanted
-
02:18:14 Okay, so let's take notes of lecture eight in the lecture eight.
-
02:18:21 What we did was we have defined custom action name.
-
02:18:38 to Define custom path and action name for Server post
-
02:18:48 Banks needs
-
02:18:51 HTML begin form
-
02:18:57 Okay, what else we did?
-
02:19:07 Okay how to
-
02:19:12 Set validation.
-
02:19:13 Elevation and elevation okay how to set requirements?
-
02:19:23 The Morgan properties.
-
02:19:25 Messages to panties, okay.
-
02:19:31 How to display validation our requirements.
-
02:19:40 Results at the user's screen at the client site.
-
02:19:51 Okay.
-
02:19:52 how to display validation somebody
-
02:20:04 Okay.
-
02:20:09 Okay, what else?
-
02:20:20 how to move objects
-
02:20:48 for example
-
02:20:59 And this is the our model how to generate custom validation inheriting validation attributes.
-
02:21:15 Okay.
-
02:21:17 How to generate a custom validation for model?
-
02:21:25 A model properties using traditional heritage
-
02:21:31 Everything.
-
02:21:34 Okay, and what else results?
-
02:21:45 We don't need to provoke them.
-
02:21:52 different types of requirements
-
02:21:58 case
-
02:22:08 okay, I think also being you should also write this note this how to modify display Wheels.
-
02:22:45 ouch
-
02:22:47 difference
-
02:22:49 input
-
02:22:51 times at the client-side with using
-
02:23:09 Type property of text box for.
-
02:23:26 Okay, so let me upload the sports coat.
-
02:23:33 I think you should start your final project and start developing it.
-
02:23:40 And if you, of course, encounter any problems, any questions, ask them to me or your friends
-
02:23:48 from our Discord Channel as usual.
-
02:23:53 I will also update database so you can use it as a database backup.
-
02:24:01 file
-
02:24:03 so let's add it too.
-
02:24:09 The yes, okay, then it's PMS Bach.
-
02:24:13 I mean back up.
-
02:24:19 So I will just delete it.
-
02:24:28 Here's
-
02:24:29 okay.
-
02:24:31 Yes.
-
02:24:32 And let's copy and paste it into our lecture 8.
-
02:24:47 You know.
-
02:24:50 Okay, so no time to update.
-
02:24:55 the GitHub repository
-
02:24:56 Hey.
-
02:25:04 Okay, hoping to see you next week.
-
02:25:30 Try to be safe from coronavirus.
-
02:25:34 I hope you be well.
-
02:25:36 Alright, and of lecture 8
