Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating and Configuring Models Models create කිරීම සහ config කර ගැනීම

Similar presentations


Presentation on theme: "Creating and Configuring Models Models create කිරීම සහ config කර ගැනීම"— Presentation transcript:

1 Creating and Configuring Models Models create කිරීම සහ config කර ගැනීම
Module 2 Omal Perera | @omalperera Microsoft Virtual Academy

2 Module Overview Model එකක් කියන්නේ මොකද්ද? Model එකක් create කර ගැනීම
Advanced Model Concepts Microsoft Virtual Academy

3 Model එකක් යනු කුමක්ද? Module 2 Microsoft Virtual Academy

4 What is a Model? සරලව Model එකක් කියන්නේ class එකක්

5 Model එකක් create කර ගැනීම
Module 2 Microsoft Virtual Academy

6 Adding a Model 20486A 03: Developing ASP.NET MVC 4 Models
(More notes on the next slide)

7 Model එක use කරන්නේ කවුරුන්ද?
User ඔවුන් interact වෙන්නේ මොනවත් සමගද? MVC Input controls Display formatting Validation

8 Models සාදා ගැනීම Attributes Available Attributes
“Decorate” properties Available Attributes DataTypeAttribute DisplayAttribute Validation RequiredAttribute StringLengthAttribute RegularExpressionAttribute CompareAttribute

9 Data Types Validation Input controls Available Data Types HTML5
CreditCard Currency Address Password Url

10 Adding DataType Attribute
03: Developing ASP.NET MVC 4 Models Demonstrate adding attribute & resulting HTML Adding DataType Attribute (More notes on the next slide)

11 Prompts Display Attribute Name Display prompt and header

12 DisplayFormat Uses a .NET format string {0:C} {0:0.00} {0:d-m-yy}
Currency {0:0.00} Always use two decimal places .42 displays as 0.42 42 displays as 42.00 {0:d-m-yy} Single digit day & month, two digit year June 10th, 2014 displays as us/library/system.string.format(v=vs.110).aspx

13 Controlling Display 20486A 03: Developing ASP.NET MVC 4 Models
Demonstrate adding attribute & resulting HTML Controlling Display (More notes on the next slide)

14 Adding Validation Attributes Error Message Required StringLength
MinLength MaxLength RegularExpression Range Error Message {0} will use the display name "{0} must be provided"

15 Validation එක සිද්ධ වෙන්නේ කොහෙදීද?
Server එකේදී ModelState.IsValid property Client මත දී jQuery unobtrusive validation අවශ්‍ය වේ

16 Adding Validation

17 Advanced Model Concepts
Module 2 Microsoft Virtual Academy

18 Models වලින් කාර්ය පහසු කරන්නේ කෙසේද?
20486A Models වලින් කාර්ය පහසු කරන්නේ කෙසේද? 03: Developing ASP.NET MVC 4 Models Automatic UI creation Model Binding Controllers are classes Actions are methods Methods take parameters MVC will convert forms to parameters

19 Advanced Model Concepts
Custom Validation Attributes built-in attributes ඔබට අවශ්‍ය ලෙස නොමැති විට Integrates with MVC View Model domain and user interface අතර වෙනස Complex data Dropdown lists Unrelated objects

20


Download ppt "Creating and Configuring Models Models create කිරීම සහ config කර ගැනීම"

Similar presentations


Ads by Google