i
Web Application Fundamentals
Using Internet Information Services
Web Forms
ASP.NET MVC
Web Services
ASP.NET Features
Request/Response Programming
HttpRequest Class
HTTP Collections
HttpResponse Class
Redirection
HttpUtility Class
Using Visual Web Developer
Visual Studio Forms Designer
Using Components
Shadow Copying
Using the Global.asax File
Data Binding
Different Types Of Caching
How to use Object cache
Optimizing Your ASP.NET Application
What Is Caching [Storage]
Forms Authentication
Windows Authentication
ASP.NET Security Fundamentals
Data Source Controls
SqlDataSource
SiteMapDataSource
The AccessDataSource Control
ObjectDataSource
Connection String Storage
GridView
DetailsView
FormView
ListView
DataPager
Entity Data Model
EntityDataSource
Remote Method Calls
Ajax Control Toolkit
Ajax Client Library
Rich Client Applications
Ajax [Asynchronous JavaScript and XML]
ScriptManager
UpdatePanel
Model-View-Controller Pattern
ASP.NET MVC versus Web Forms
ASP.NET MVC Projects in Visual Studio
Action Methods in MVC
Routing in MVC
Strongly-Typed Views [Add images here from the visual studio]
Model Binding
Validation
ADO.NET [ActiveX Data Object]
ASP.NET Data Providers
Connections
Commands
DataReaders and Connected Access
DataSets and Disconnected Access
Validations mean applying some rules so the user cannot enter the wrong input. In MVC Data annotation is used to do the modal validation. The data annotation is an inherited System.ComponentModel.DataAnnotations assembly. In the HTML view, you do not even need to add a label.
The "ComponentModel.DataAnnotations" assembly has many built-in validation attributes, for example:
Required
Range,
RegularExpression,
Compare
StringLength
Data type
Sr.No |
|
|
1 |
RegularExpression |
The value should match with given Regular Expression |
2 |
MaxLength |
Maximum length for text box/text area |
3 |
MinLength |
Minimum length for text box/text area |
4 |
Required |
The field is required |
5 |
EmailAddress |
Validate email address against the predefined format |
6 |
StringLength |
Specifies maximum length for text box/text area |
7 |
Range |
Specifies maximum and minimum length for a numeric field |
8 |
Phone |
Validate the expression for phone numbers with the given regularExpression |
Ex:
public class Employee { public int EmployeeId { get; set; }
[Required] public string Name { get; set; }
[Range(20,60)] public int Age { get; set; } }
|
|
Output:
Don't miss out!