ASP.net MVC

Embed Size (px)

Text of ASP.net MVC

1

ASP.NET MVCAGENDAMVC (Model-View-Control)ASP.NET MVC

MVC (Model-View-Control)What is MVC1979smalltalkDesign Pattern() or framework ()Separation of Concerns ()

ComponentsView () Control ()Model () The relationship between MVC

1. 2. 123. 34ASP.NET MVCViewHTML/XML/CSSJSONJavascript (jQuey, JQuery UI, Ext JS,)AJAXControlASP.NET ControllerModelADO.NETEntity FrameworkLINQ to SQLDatabase operationASP.NET MVC & Web FormWeb Form (viewstate)HTML & CSSMVC

ASP.NET MVC & Web FormWeb FormView basedDesign FlowOrderaddorder.aspxUIdatasourceExample CodeFile structureAboutRegister/login

MVCController basedDesign FlowURLControllerModelmodelviewviewExample CodeFile structureAboutRegister/login

ModelControllerView SNMP

KeyIndexintDeviceNamenvarchar(32)DeviceIPvarhar(32)SNMPVersionint1 ~ 2ReadCommunityvarchar(32)WriteCommunityvarchar(32)DeviceTypeintDeviceStatusint ModelModels-> -> ->

ModelDeviceInfo.cs (Code First)using System.ComponentModel;using System.ComponentModel.DataAnnotations;[Key][Required]null[DisplayName()]View[MaxLength(32)][Range(1, 2)]

ControllerController -> -> ->

ViewDeviceTypeDeviceStatusModelRouteConfig.csDeviceInfoController.csIndex.cshtmlCreate.cshtml