SlideShare une entreprise Scribd logo
1  sur  20
*Source: http://www.dilbert.com/
We will start in few minutes…
Fast track introduction to
ASP.NET MVC
-Ankit Kashyap
(Analyst Programmer)
ankit.Kashyap@wipro.com
About Me
• Proud Wiproite from last 6 yrs.
• Works as Analyst Programmer for Wipro MS-AppC team
• Web developer (+ Azure, SQL/EF; Windows Store and xamarin/android)
• @ankitwww www.linkedin.com/in/ankitwww/
This session
• Prerequisites:
 A little prior knowledge of ASP.NET Web form
 C#
 Software – Visual Studio 2012/2013 express edition
• Slides Available @ http://www.slideshare.net/AnkitKashyap/fast-track-introduction-to-aspnet-mvc
• Content level – Beginners
• Demo based!! Slides for your notes.
Agenda
• The MVC Pattern
• ASP.NET MVC vs Web Form
• ASP.NET MVC Routing
• Controllers and Actions
• Razor Views
• HTML Helpers and Partial Views
• Unit Testing
• General Tips and best practices
I love ASPX! Seriously??
• Let’s do a demo!
• Make a ASP.NET Web form solution
• ASPX vs the real web page
ASP.NET Web forms
• Abstract away the web!
• Focus on Server side processing
• Code behind and Server control
• Table => GridView
• Click events replaces “Post” operation
• Originally design from/for late 90s technologies
• Now web standards have strengthened
• Client side programming on the rise
ASP.NET MVC – Design goals
• Does not replace web forms! An alternative…
• Still runs on ASP.NET
• All awesomeness still available – modules, handlers, master pages, session
state, Caching, auth.
• Embrace the web
• No illusions of state – No Page lifecycle
• Clean HTML and clean URLs
• Separation of concerns!!! – You will love it!
• Testable – Big win
MVC pattern
How it serves Requests? • Controller contains Action
methods
• Every Action method can return
a View (and raw json and other
formats)
MVC Routing
• Routing is the magic component!
• Directs incoming requests to an MVC Controller
• Defines routes during application startup
• Map URLs to control action with parameters
• System.Web.Routing Binary – Part of ASP.NET
Controller
• Heart of MVC
• Contains public method called as Actions
• Method invokes by ASP.NET once routing decides the proper path
• Returns an ActionResult – Tells the framework what to do next
View
• Strongly typed!
• How we intermingled C# and HTML?
• Razor view engine – converts C# into actual HMTL @ Server
Demo Time!!!
Model
• Contains business/domain logic
• Doesn’t bother about presentation of Data
• May (or may not) contains database access logic
• Server side validation for Business logic
Demo: Creating a model from POCO classes
HTML Helper & ViewBag
• Quick, clean and short way
• Helpers available for frequently used html elements
• ViewBag contains Key-Value dictionary pairs.
• Can be passed from Action to View
Partial Views
Quick Demo
Layout and _ViewStart
• Layout views are “master pages”
• _ViewStart.cshtml – Code inside this view executes before every view
renders
Further Resources
• http://www.asp.net/mvc
• Tutorials - http://www.asp.net/mvc/tutorials
• http://www.codeproject.com/Articles/207797/Learn-MVC-Model-
View-Controller-step-by-step-in
That’s all!!
@ankitwww www.linkedin.com/in/ankitwww/ http://www.slideshare.net/AnkitKashyap/fast-track-
introduction-to-aspnet-mvc

Contenu connexe

Tendances

From PowerShell Function to Serverless code with Azure Functions
From PowerShell Function to Serverless code with Azure FunctionsFrom PowerShell Function to Serverless code with Azure Functions
From PowerShell Function to Serverless code with Azure FunctionsJaap Brasser
 
Unit Testing Asp.net and Asp.net MVC
Unit Testing Asp.net and Asp.net MVCUnit Testing Asp.net and Asp.net MVC
Unit Testing Asp.net and Asp.net MVCGil Zilberfeld
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCSirwan Afifi
 
Automate it with Azure Functions
Automate it with Azure FunctionsAutomate it with Azure Functions
Automate it with Azure FunctionsJaap Brasser
 
Building rest services using aspnetwebapi
Building rest services using aspnetwebapiBuilding rest services using aspnetwebapi
Building rest services using aspnetwebapiBrij Mishra
 
Automate everything with PowerShell
Automate everything with PowerShellAutomate everything with PowerShell
Automate everything with PowerShellJaap Brasser
 
Create awesome Azure Functions with PowerShell
Create awesome Azure Functions with PowerShellCreate awesome Azure Functions with PowerShell
Create awesome Azure Functions with PowerShellJaap Brasser
 
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014Enea Gabriel
 
Navigate around the edge with PowerShell
Navigate around the edge with PowerShellNavigate around the edge with PowerShell
Navigate around the edge with PowerShellJaap Brasser
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part IRohit Rao
 
10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps FasterBrij Mishra
 
Microsoft Flow and PowerShell combined to automate everything
Microsoft Flow and PowerShell combined to automate everythingMicrosoft Flow and PowerShell combined to automate everything
Microsoft Flow and PowerShell combined to automate everythingJaap Brasser
 
Code igniter overview
Code igniter overviewCode igniter overview
Code igniter overviewumesh patil
 
Getting Started with ASP.NET 5
Getting Started with ASP.NET 5Getting Started with ASP.NET 5
Getting Started with ASP.NET 5Brij Mishra
 
Agile Apps with App Engine
Agile Apps with App EngineAgile Apps with App Engine
Agile Apps with App EngineCalvin Cheng
 
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure FunctionsSébastien Levert
 
Discover Microsoft's Cloud Automation Suite
Discover Microsoft's Cloud Automation SuiteDiscover Microsoft's Cloud Automation Suite
Discover Microsoft's Cloud Automation SuiteJaap Brasser
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Jeremy Likness
 

Tendances (20)

From PowerShell Function to Serverless code with Azure Functions
From PowerShell Function to Serverless code with Azure FunctionsFrom PowerShell Function to Serverless code with Azure Functions
From PowerShell Function to Serverless code with Azure Functions
 
Unit Testing Asp.net and Asp.net MVC
Unit Testing Asp.net and Asp.net MVCUnit Testing Asp.net and Asp.net MVC
Unit Testing Asp.net and Asp.net MVC
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Automate it with Azure Functions
Automate it with Azure FunctionsAutomate it with Azure Functions
Automate it with Azure Functions
 
Building rest services using aspnetwebapi
Building rest services using aspnetwebapiBuilding rest services using aspnetwebapi
Building rest services using aspnetwebapi
 
Hello world - intro to node js
Hello world - intro to node jsHello world - intro to node js
Hello world - intro to node js
 
Automate everything with PowerShell
Automate everything with PowerShellAutomate everything with PowerShell
Automate everything with PowerShell
 
Create awesome Azure Functions with PowerShell
Create awesome Azure Functions with PowerShellCreate awesome Azure Functions with PowerShell
Create awesome Azure Functions with PowerShell
 
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
 
Navigate around the edge with PowerShell
Navigate around the edge with PowerShellNavigate around the edge with PowerShell
Navigate around the edge with PowerShell
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I
 
10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster
 
Microsoft Flow and PowerShell combined to automate everything
Microsoft Flow and PowerShell combined to automate everythingMicrosoft Flow and PowerShell combined to automate everything
Microsoft Flow and PowerShell combined to automate everything
 
Code igniter overview
Code igniter overviewCode igniter overview
Code igniter overview
 
Getting Started with ASP.NET 5
Getting Started with ASP.NET 5Getting Started with ASP.NET 5
Getting Started with ASP.NET 5
 
SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6
 
Agile Apps with App Engine
Agile Apps with App EngineAgile Apps with App Engine
Agile Apps with App Engine
 
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
 
Discover Microsoft's Cloud Automation Suite
Discover Microsoft's Cloud Automation SuiteDiscover Microsoft's Cloud Automation Suite
Discover Microsoft's Cloud Automation Suite
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 

Similaire à Fast Track introduction to ASP.NET MVC

Sitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantSitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantnonlinear creations
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8Thomas Robbins
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSGil Fink
 
Lightweight webdev
Lightweight webdevLightweight webdev
Lightweight webdevdamianofusco
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples Yochay Kiriaty
 
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
 
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Dot Net Tricks
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introductionFajar Baskoro
 
Migration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET CoreMigration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET CoreMiroslav Popovic
 
Hanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvcHanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvcdenemedeniz
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2Erik Noren
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentationMaslowB
 
MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017Innovation Studio
 

Similaire à Fast Track introduction to ASP.NET MVC (20)

Sitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantSitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's important
 
Sitecore mvc
Sitecore mvcSitecore mvc
Sitecore mvc
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
 
Aspnet mvc
Aspnet mvcAspnet mvc
Aspnet mvc
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJS
 
Lightweight webdev
Lightweight webdevLightweight webdev
Lightweight webdev
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
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
 
ASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So FarASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So Far
 
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
 
Webinar MVC6
Webinar MVC6Webinar MVC6
Webinar MVC6
 
Mvc
MvcMvc
Mvc
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introduction
 
Migration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET CoreMigration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET Core
 
Hanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvcHanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvc
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017
 

Plus de Ankit Kashyap

Xamarin - Why I started learning it?
Xamarin - Why I started learning it?Xamarin - Why I started learning it?
Xamarin - Why I started learning it?Ankit Kashyap
 
Azure SQL, Blobs and ATS
Azure SQL, Blobs and ATSAzure SQL, Blobs and ATS
Azure SQL, Blobs and ATSAnkit Kashyap
 
Azure fundamentals Part 1
Azure fundamentals Part 1 Azure fundamentals Part 1
Azure fundamentals Part 1 Ankit Kashyap
 
Wipro hackathon tekpill
Wipro hackathon tekpillWipro hackathon tekpill
Wipro hackathon tekpillAnkit Kashyap
 
C# basics training (tips and tricks)
C# basics training (tips and tricks)C# basics training (tips and tricks)
C# basics training (tips and tricks)Ankit Kashyap
 
C# basics training (Interfaces)
C# basics training (Interfaces)C# basics training (Interfaces)
C# basics training (Interfaces)Ankit Kashyap
 
C# basics training (Inheritance)
C# basics training (Inheritance)C# basics training (Inheritance)
C# basics training (Inheritance)Ankit Kashyap
 
Fast Track - Windows 8 Apps
Fast Track - Windows 8 AppsFast Track - Windows 8 Apps
Fast Track - Windows 8 AppsAnkit Kashyap
 

Plus de Ankit Kashyap (9)

Xamarin - Why I started learning it?
Xamarin - Why I started learning it?Xamarin - Why I started learning it?
Xamarin - Why I started learning it?
 
Azure SQL, Blobs and ATS
Azure SQL, Blobs and ATSAzure SQL, Blobs and ATS
Azure SQL, Blobs and ATS
 
Azure fundamentals Part 1
Azure fundamentals Part 1 Azure fundamentals Part 1
Azure fundamentals Part 1
 
Wipro hackathon tekpill
Wipro hackathon tekpillWipro hackathon tekpill
Wipro hackathon tekpill
 
Code workshop
Code workshopCode workshop
Code workshop
 
C# basics training (tips and tricks)
C# basics training (tips and tricks)C# basics training (tips and tricks)
C# basics training (tips and tricks)
 
C# basics training (Interfaces)
C# basics training (Interfaces)C# basics training (Interfaces)
C# basics training (Interfaces)
 
C# basics training (Inheritance)
C# basics training (Inheritance)C# basics training (Inheritance)
C# basics training (Inheritance)
 
Fast Track - Windows 8 Apps
Fast Track - Windows 8 AppsFast Track - Windows 8 Apps
Fast Track - Windows 8 Apps
 

Dernier

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Dernier (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Fast Track introduction to ASP.NET MVC

  • 2. Fast track introduction to ASP.NET MVC -Ankit Kashyap (Analyst Programmer) ankit.Kashyap@wipro.com
  • 3. About Me • Proud Wiproite from last 6 yrs. • Works as Analyst Programmer for Wipro MS-AppC team • Web developer (+ Azure, SQL/EF; Windows Store and xamarin/android) • @ankitwww www.linkedin.com/in/ankitwww/
  • 4. This session • Prerequisites:  A little prior knowledge of ASP.NET Web form  C#  Software – Visual Studio 2012/2013 express edition • Slides Available @ http://www.slideshare.net/AnkitKashyap/fast-track-introduction-to-aspnet-mvc • Content level – Beginners • Demo based!! Slides for your notes.
  • 5. Agenda • The MVC Pattern • ASP.NET MVC vs Web Form • ASP.NET MVC Routing • Controllers and Actions • Razor Views • HTML Helpers and Partial Views • Unit Testing • General Tips and best practices
  • 6. I love ASPX! Seriously?? • Let’s do a demo! • Make a ASP.NET Web form solution • ASPX vs the real web page
  • 7. ASP.NET Web forms • Abstract away the web! • Focus on Server side processing • Code behind and Server control • Table => GridView • Click events replaces “Post” operation • Originally design from/for late 90s technologies • Now web standards have strengthened • Client side programming on the rise
  • 8. ASP.NET MVC – Design goals • Does not replace web forms! An alternative… • Still runs on ASP.NET • All awesomeness still available – modules, handlers, master pages, session state, Caching, auth. • Embrace the web • No illusions of state – No Page lifecycle • Clean HTML and clean URLs • Separation of concerns!!! – You will love it! • Testable – Big win
  • 10. How it serves Requests? • Controller contains Action methods • Every Action method can return a View (and raw json and other formats)
  • 11. MVC Routing • Routing is the magic component! • Directs incoming requests to an MVC Controller • Defines routes during application startup • Map URLs to control action with parameters • System.Web.Routing Binary – Part of ASP.NET
  • 12. Controller • Heart of MVC • Contains public method called as Actions • Method invokes by ASP.NET once routing decides the proper path • Returns an ActionResult – Tells the framework what to do next
  • 13. View • Strongly typed! • How we intermingled C# and HTML? • Razor view engine – converts C# into actual HMTL @ Server
  • 15. Model • Contains business/domain logic • Doesn’t bother about presentation of Data • May (or may not) contains database access logic • Server side validation for Business logic Demo: Creating a model from POCO classes
  • 16. HTML Helper & ViewBag • Quick, clean and short way • Helpers available for frequently used html elements • ViewBag contains Key-Value dictionary pairs. • Can be passed from Action to View
  • 18. Layout and _ViewStart • Layout views are “master pages” • _ViewStart.cshtml – Code inside this view executes before every view renders
  • 19. Further Resources • http://www.asp.net/mvc • Tutorials - http://www.asp.net/mvc/tutorials • http://www.codeproject.com/Articles/207797/Learn-MVC-Model- View-Controller-step-by-step-in
  • 20. That’s all!! @ankitwww www.linkedin.com/in/ankitwww/ http://www.slideshare.net/AnkitKashyap/fast-track- introduction-to-aspnet-mvc