SlideShare a Scribd company logo
1 of 36
Download to read offline
ASP.NET MVC
Bhavin Shah
Software Engineer @ Sfw India Pvt. Ltd .
Agenda
Beforehand – ASP.NET Web Forms
What is MVC
What is ASP.NET MVC?
Models
Views
Controllers
Validation
Routing
Unit Tests
View engines
2
ASP.NET Web Forms
Rich controls and tools
Postbacks
Event driven web development
Viewstate
Less control over the HTML
Hard to test
Rapid development
3
Let’s chat for a bit…
4
What is MVC
5
Model – View - Controller
6
Controller - responsible for handling all user
input
Model - represents the logic of the application
View - the visual representation of the model
ASP.NET MVC
More control over HTML
No Codebehind
Separation of concerns
Easy to test
URL routing
No postbacks
No ViewState
7
Models
The model should contain all of the application
business logic, validation logic, and database
access logic.
ASP.NET MVC is compatible with any data
access technology (for example LINQ to SQL)
All .edmx files, .dbml files etc. are located in
the Models folder.
8
Custom View Models
9
When you combine properties to display on a
View
namespace ContosoUniversity.ViewModels
{
public class AssignedCourseData
{
public int CourseID { get; set; }
public string Title { get; set; }
public bool Assigned { get; set; }
}
}
Creating a Model - DEMO
10
What is Controller?
It is a class
Derives from the base
System.Web.Mvc.Controller class
Generates the response to the browser request
11
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
return View();
}
public ActionResult About()
{
return View();
}
}
Controller Actions
Public method of the Controller class
Cannot be overloaded
Cannot be a static method
Returns action result
12
public ActionResult About()
{
return View();
}
Action Results
Controller action response to a browser
request
Inherits from the base ActionResult class
Different results types
13
Implement a Controller -
DEMO
14
Action Results Types
ViewResult
EmptyResult
RedirectResult
JsonResult
JavaScriptResult
ContentResult
FileContentResult
FileStreamResult
FilePathResult
15
Controller base class
methodsView
Redirect
RedirectToAction
RedirectToRoute
Json
JavaScriptResult
Content
File
16
Views
Most of the Controller Actions return views
The path to the view is inferred from the name
of the controller and the name of the
controller action.
ViewsControllerNameControllerAction.aspx
A view is a standard (X)HTML document that
can contain scripts.
script delimiters <% and %> in the views
17
Pass Data to a View
With ViewData:
ViewData["message"] = "Hello World!";
Strongly typed ViewData:
− ViewData.Model = OurModel;
With ViewBag:
ViewBag.Message = "Hello World!";
18
Post data to a controller
Verb Attributes
The action method in the controller accepts the
values posted from the view.
The view form fields must match the same
names in the controller.
19
[HttpPost]
public ActionResult Edit(Movie movie)
{
if (ModelState.IsValid)
{
db.Entry(movie).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Index");
}
return View(movie);
}
Explore a View - DEMO
20
HTML Helpers
Methods which typically return string.
Used to generate standard HTML elements
textboxes, dropdown lists, links etc.
Example: Html.TextBox() method
Usage is optional
You can create your own HTML Helpers
21
Validation
Two types of validation error messages
generated before the HTML form fields are
bound to a class
generated after the form fields are bound to the
class
Model State
Validation Helpers
Html.ValidationMessage()
Html.ValidationSummary()
22
ventsypopov.com
Implement validation- DEMO
23
Routing
The Routing module is responsible for
mapping incoming browser requests to
particular MVC controller actions.
Two places to setup:
Web.config file
Global.asax file
24
Routing Setup
Web.config file
25
<system.web>
<httpModules>
…
<system.web>
<httpHandlers>
…
<system.webServer>
<modules> …
<system.webServer>
<handlers>
…
Routing Setup
Global.asax file
26
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home",
action = "Index", id = "" }
);
}
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
}
}
URL Example
http://www.mysite.com/Home/About/6
{controller} = Home
{action} = About
{id} = 6
27
ventsypopov.com
Routing example - DEMO
28
ventsypopov.com
Unit Tests
Used for the business logic (not DAL or View
logic).
Test individual “unit”of code
Make the code safe to modify
Mock Object framework
When you lack “real” objects
Create mocks for the classes in the application
Test with mock objects
29
Unit Tests - DEMO
30
ventsypopov.com
View Engines
Handles the rendering of the view to UI
(html/xml);
Different view engines have different syntax
ASP.NET MVC 3 Pre-included View Engines:
Web Forms
Razor
31
View Engines - DEMO
32
Things to remember
What MVC stands for
How ASP.NET MVC differs from Web Forms
Where is routing configured
How to validate business logic
How to use helpers
Unit tests basics
Choice between “View Engines”
33
Useful sites
http://www.asp.net/mvc
http://msdn.microsoft.com/en-us/library/dd39470
http://stackoverflow.com/
http://jquery.com/
34
ASP.NET MVC
Email: bhavinshah1988@gmail.com
Time to wake up :)
36

More Related Content

What's hot (20)

Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code first
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
Web api
Web apiWeb api
Web api
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
Web Development with Python and Django
Web Development with Python and DjangoWeb Development with Python and Django
Web Development with Python and Django
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
 
Why MVC?
Why MVC?Why MVC?
Why MVC?
 
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
 
ASP.NET Basics
ASP.NET Basics ASP.NET Basics
ASP.NET Basics
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 

Similar to ASP.NET MVC Architecture and Core Concepts

ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamentalldcphuc
 
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOSSoftware architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOSJinkyu Kim
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe
 
AspMVC4 start101
AspMVC4 start101AspMVC4 start101
AspMVC4 start101Rich Helton
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Thomas Robbins
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Sparkhound Inc.
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)Hatem Hamad
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan Uzun
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET WebskillsCaleb Jenkins
 
Building a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 MinutesBuilding a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 MinutesGaines Kergosien
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCJulia Vi
 

Similar to ASP.NET MVC Architecture and Core Concepts (20)

Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
MVC 4
MVC 4MVC 4
MVC 4
 
ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamental
 
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOSSoftware architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
 
ASP.NET-MVC-Part-1.ppt
ASP.NET-MVC-Part-1.pptASP.NET-MVC-Part-1.ppt
ASP.NET-MVC-Part-1.ppt
 
AspMVC4 start101
AspMVC4 start101AspMVC4 start101
AspMVC4 start101
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
 
Intro ASP MVC
Intro ASP MVCIntro ASP MVC
Intro ASP MVC
 
Frameworks
FrameworksFrameworks
Frameworks
 
ASP.MVC Training
ASP.MVC TrainingASP.MVC Training
ASP.MVC Training
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET Webskills
 
Building a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 MinutesBuilding a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 Minutes
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Asp 1a-aspnetmvc
Asp 1a-aspnetmvcAsp 1a-aspnetmvc
Asp 1a-aspnetmvc
 

More from Bhavin Shah

Node Session - 4
Node Session - 4Node Session - 4
Node Session - 4Bhavin Shah
 
Node Session - 3
Node Session - 3Node Session - 3
Node Session - 3Bhavin Shah
 
Node Session - 2
Node Session - 2Node Session - 2
Node Session - 2Bhavin Shah
 
Node Session - 1
Node Session - 1Node Session - 1
Node Session - 1Bhavin Shah
 
What is Penetration & Penetration test ?
What is Penetration & Penetration test ?What is Penetration & Penetration test ?
What is Penetration & Penetration test ?Bhavin Shah
 

More from Bhavin Shah (6)

Node Session - 4
Node Session - 4Node Session - 4
Node Session - 4
 
Node Session - 3
Node Session - 3Node Session - 3
Node Session - 3
 
Node Session - 2
Node Session - 2Node Session - 2
Node Session - 2
 
Node Session - 1
Node Session - 1Node Session - 1
Node Session - 1
 
What is Penetration & Penetration test ?
What is Penetration & Penetration test ?What is Penetration & Penetration test ?
What is Penetration & Penetration test ?
 
Cyber security
Cyber securityCyber security
Cyber security
 

Recently uploaded

Automation Ops Series: Session 3 - Solutions management
Automation Ops Series: Session 3 - Solutions managementAutomation Ops Series: Session 3 - Solutions management
Automation Ops Series: Session 3 - Solutions managementDianaGray10
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Women in Automation 2024: Career session - explore career paths in automation
Women in Automation 2024: Career session - explore career paths in automationWomen in Automation 2024: Career session - explore career paths in automation
Women in Automation 2024: Career session - explore career paths in automationDianaGray10
 
Transcript: Green paths: Learning from publishers’ sustainability journeys - ...
Transcript: Green paths: Learning from publishers’ sustainability journeys - ...Transcript: Green paths: Learning from publishers’ sustainability journeys - ...
Transcript: Green paths: Learning from publishers’ sustainability journeys - ...BookNet Canada
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Transport in Open Pits______SM_MI10415MI
Transport in Open Pits______SM_MI10415MITransport in Open Pits______SM_MI10415MI
Transport in Open Pits______SM_MI10415MIRomil Mishra
 
Green paths: Learning from publishers’ sustainability journeys - Tech Forum 2024
Green paths: Learning from publishers’ sustainability journeys - Tech Forum 2024Green paths: Learning from publishers’ sustainability journeys - Tech Forum 2024
Green paths: Learning from publishers’ sustainability journeys - Tech Forum 2024BookNet Canada
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneUiPathCommunity
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Bitdefender-CSG-Report-creat7534-interactive
Bitdefender-CSG-Report-creat7534-interactiveBitdefender-CSG-Report-creat7534-interactive
Bitdefender-CSG-Report-creat7534-interactivestartupro
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Laying the Data Foundations for Artificial Intelligence!
Laying the Data Foundations for Artificial Intelligence!Laying the Data Foundations for Artificial Intelligence!
Laying the Data Foundations for Artificial Intelligence!Memoori
 
A PowerPoint Presentation on Vikram Lander pptx
A PowerPoint Presentation on Vikram Lander pptxA PowerPoint Presentation on Vikram Lander pptx
A PowerPoint Presentation on Vikram Lander pptxatharvdev2010
 
Software Security in the Real World w/Kelsey Hightower
Software Security in the Real World w/Kelsey HightowerSoftware Security in the Real World w/Kelsey Hightower
Software Security in the Real World w/Kelsey HightowerAnchore
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 

Recently uploaded (20)

Automation Ops Series: Session 3 - Solutions management
Automation Ops Series: Session 3 - Solutions managementAutomation Ops Series: Session 3 - Solutions management
Automation Ops Series: Session 3 - Solutions management
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Women in Automation 2024: Career session - explore career paths in automation
Women in Automation 2024: Career session - explore career paths in automationWomen in Automation 2024: Career session - explore career paths in automation
Women in Automation 2024: Career session - explore career paths in automation
 
Transcript: Green paths: Learning from publishers’ sustainability journeys - ...
Transcript: Green paths: Learning from publishers’ sustainability journeys - ...Transcript: Green paths: Learning from publishers’ sustainability journeys - ...
Transcript: Green paths: Learning from publishers’ sustainability journeys - ...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Transport in Open Pits______SM_MI10415MI
Transport in Open Pits______SM_MI10415MITransport in Open Pits______SM_MI10415MI
Transport in Open Pits______SM_MI10415MI
 
Green paths: Learning from publishers’ sustainability journeys - Tech Forum 2024
Green paths: Learning from publishers’ sustainability journeys - Tech Forum 2024Green paths: Learning from publishers’ sustainability journeys - Tech Forum 2024
Green paths: Learning from publishers’ sustainability journeys - Tech Forum 2024
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyone
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Bitdefender-CSG-Report-creat7534-interactive
Bitdefender-CSG-Report-creat7534-interactiveBitdefender-CSG-Report-creat7534-interactive
Bitdefender-CSG-Report-creat7534-interactive
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Laying the Data Foundations for Artificial Intelligence!
Laying the Data Foundations for Artificial Intelligence!Laying the Data Foundations for Artificial Intelligence!
Laying the Data Foundations for Artificial Intelligence!
 
A PowerPoint Presentation on Vikram Lander pptx
A PowerPoint Presentation on Vikram Lander pptxA PowerPoint Presentation on Vikram Lander pptx
A PowerPoint Presentation on Vikram Lander pptx
 
Software Security in the Real World w/Kelsey Hightower
Software Security in the Real World w/Kelsey HightowerSoftware Security in the Real World w/Kelsey Hightower
Software Security in the Real World w/Kelsey Hightower
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 

ASP.NET MVC Architecture and Core Concepts

Editor's Notes

  1. Анализ при архитектурни решения – взимаме стратегически решения свързани с бизнес нуждите на системата, която изграждаме. Обмисляме сигурност, производителност, поддръжка, надеждност, интеграция с тестови приложения, леснота и удобство на употреба на системата. Проблеми, с които се сблъскваме: Честа смяна на потребителски интерфейс Различно представяне на едни и същи данни Работа върху различни устройства Улеснено модулно тестване на системата Как да ги решаваме: Независимост на отделните модули Преизползваемост на модулите Добра структурна организация на системата
  2. Viewresult - If you want an action method to result in a rendered view, the action method should return a call to the controller&amp;apos;s View helper method. The View helper method passes a ViewResult object to the ASP.NET MVC framework, which calls the object&amp;apos;s ExecuteResult method. JsonResult - Represents a class that is used to send JSON-formatted content to the response. JavaScriptResult - Sends JavaScript content to the response. ContentResult - Represents a user-defined content type that is the result of an action method. FileContntResult - Represents a class that is used to send binary file content to the response FileStreamResult - Sends binary content to the response by using a Stream instance. FilePathResult - Sends the contents of a file to the response
  3. View - Creates a ViewResult object that renders a view to the response. Redirect - Creates a RedirectResult object that redirects to the specified URL. RedirectToAction - Redirects to the specified action using the action name Json - Creates a JsonResult object that serializes the specified object to JavaScript Object Notation (JSON) format. JavaScript - Creates a JavaScriptResult object Content - Creates a content result object by using a string. File - Creates a FileContentResult object by using the file contents and file type.
  4. To create HTML helper – a class with public static string methods and refer the namespace in the view.
  5. Html.ValidationMessage() - Displays a validation message if an error exists for the specified field in the ModelStateDictionary object Html.ValidationSummary() - Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object.