SlideShare une entreprise Scribd logo
1  sur  20
INDIA │ 9-11 February 2011
virtual techdays

 SESSION TITLE
 Kamala Rajan S │ Technical Manager, Marlabs
INDIA │ 9-11 February 2011
virtual techdays
 SESSION AGENDA


 A Brief Overview of ASP.MVC Concepts
     Introduction
     Routing, Controllers & Views


 A walkthrough of new features in ASP.NET MVC 3
     View Engines (Razor)
     Unobtrusive Ajax and Unobtrusive Client Side Validation
     Dependency resolver
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 Classic ASP.Net - Main Features
      High level abstraction over HTML / HTTP
      Simplified state management
      ViewState and the post‐back model
      Control model
      Data binding
      Simple event‐driven mechanism
      Simple Page Controller pattern
      And lots more as well...
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 Classic ASP.Net – Some down sides
    Sub‐optimal URLs
         blog.aspx?date=21032008
         Form runat="server"
      ViewState
      Hard to test
      All sorts of code in the page
      Requirement to test with an HttpContext
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 ASP.NET MVC defined
      A new project‐type for VS 2010
      A new routing mechanism
      Applicable not just to ASP.NET MVC
      Easier to write using TDD
      Clean separation of concerns
      NOT a replacement for existing Web Forms
      Feel free to completely ignore ASP.NET MVC
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 ASP.NET MVC defined
INDIA │ 9-11 February 2011
virtual techdays
  ASP.NET MVC
  ASP.NET MVC defined

-Browser requests /Products/
-Route is determined
-Controller is activated
-Method on Controller is invoked
-Controller processes request
-Renders View, passing in
 custom ViewData
-URLs are rendered, pointing to other
 Controllers
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 Routing
      Routing provides "clean" URLs
      URL is mapped to a route handler
      Extra level of indirection
      Handlers can be changed without impacting URL
      URL can be changed without impacting handler
      Enables support for multilingual URLs
      URL Example : http://www.mysite.com/Home/ProductList
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 Routing
    Developers adds Routes to a global RouteTable
    Mapping creates a RouteData - a bag of key/values

  public static void RegisterRoutes(RouteCollection routes) {

             routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

             routes.MapRoute( "Default",                     // Route name
             "{controller}/{action}/{id}",                   // URL with parameters
             new { controller = "Home", action = "Index", id = "" } // Parameter defaults
             );
  }
  protected void Application_Start() {
                          RegisterRoutes(RouteTable.Routes);
             }
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 Controller Handling
 Scenarios, Goals and Design
     URLs route to controller “actions”, not pages – mark actions in Controller.
     Controller executes logic, chooses view.
     All public methods are accessible

  public void ShowPost(int id) {
       Post p = PostRepository.GetPostById(id);
       if (p != null) {
           RenderView("showpost", p);
       } else {
           RenderView("nosuchpost", id);
       }
  }
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 Views
 Scenarios, Goals and Design:
    – Are for rendering/output.
        • Pre-defined and extensible rendering helpers
    – Can use .ASPX, .ASCX, .MASTER, etc.
    – Can replace with other view technologies:
        • Template engines (NVelocity, Brail, …).
        • Output formats (images, RSS, JSON, …).
        • Mock out for testing.
    – Controller sets data on the View
        • Loosely typed or strongly typed data
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 New Features in ASP.NET MVC 3
 The Razor View Engine
   – Razor syntax is clean and concise, requiring a minimum number of keystrokes.
   – Razor is easy to learn, in part because it's based on existing languages like C#
     and Visual Basic.
   – Visual Studio includes IntelliSense and code colorization for Razor syntax.
   – Razor views can be unit tested without requiring that you run the application or
     launch a web server.
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 New Features in ASP.NET MVC 3
 Using traditional asp.net code




 Using Razor
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 New Features in ASP.NET MVC 3
 New "ViewBag" Property
        MVC 2 controllers support a ViewData property that enables you to pass
         data to a view template using a late-bound dictionary API.
        In MVC 3, you can also use somewhat simpler syntax with
         the ViewBag property to accomplish the same purpose.
        For example, instead of writing ViewData["Message"]="text", you can
         write ViewBag.Message="text".
        You do not need to define any strongly-typed classes to use
         the ViewBagproperty.
        Dynamic property, you can instead just get or set properties and it will
           resolve them dynamically at run time.
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 New Features in ASP.NET MVC 3
 New "ActionResult" Types
     HttpNotFoundResult. Returns a 404 HTTP status code to the client.
     RedirectResult. Returns a temporary redirect (HTTP 302 status code) or a permanent
      redirect (HTTP 301 status code), depending on a Boolean parameter.
     HttpStatusCodeResult. Returns a user-specified HTTP status code.


 JavaScript and Ajax Improvements
     By default, Ajax and validation helpers in MVC 3 use an unobtrusive JavaScript approach.
     Unobtrusive JavaScript avoids injecting inline JavaScript into HTML.
     This makes your HTML smaller and less cluttered, and makes it easier to swap out or
      customize JavaScript libraries.
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 New Features in ASP.NET MVC 3
Dependency Injection Improvements
 ASP.NET MVC 3 provides better support for applying Dependency Injection (DI) and
  for integrating with Dependency Injection or Inversion of Control (IOC) containers.
   Support for DI has been added in the following areas:
    –   Controllers (registering and injecting controller factories, injecting controllers).
    –   Views (registering and injecting view engines, injecting dependencies into view pages).
    –   Action filters (locating and injecting filters).
    –   Model binders (registering and injecting).
    –   Model validation providers (registering and injecting).
    –   Model metadata providers (registering and injecting).
    –   Value providers (registering and injecting).
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 New Features in ASP.NET MVC 3
Dependency Injection Improvements
 MVC 3 supports the Common Service Locator library and any DI container that
  supports that library'sIServiceLocator interface.
 It also supports a new IDependencyResolver interface that makes it easier to
  integrate DI frameworks.
 For more information about DI in MVC 3, see the following resources:
     http://bradwilson.typepad.com/blog/2010/07/service-location-pt1-introduction.html
INDIA │ 9-11 February 2011
virtual techdays
 ASP.NET MVC
 New Features in ASP.NET MVC 3
Other New Features
   NuGet Integration
   Partial-Page Output Caching
   Granular Control over Request Validation
   Scaffolding Improvements
   Sessionless Controller Support


And more..
INDIA │ 9-11 February 2011
virtual techdays
 RESOURCES


 Talk by Scott Hanselmann
     http://channel9.msdn.com/posts/matthijs/ASPNET-MVC-2-Basics-Introduction-by-Scott-
      Hanselman/
     Must watch to learn more about MVC


 Scott Guthrie’s Blog
     http://weblogs.asp.net/scottgu/archive/2010/07/27/introducing-asp-net-mvc-3-preview-
      1.aspx
THANKS│ 9-11 February 2011
virtual techdays


 Kamal.r@marlabs.com

Contenu connexe

Tendances

Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVCJohn Lewis
 
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5Aaron Jacobson
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantNitin Sawant
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015Hossein Zahed
 
25+ Reasons to use OmniFaces in JSF applications
25+ Reasons to use OmniFaces in JSF applications25+ Reasons to use OmniFaces in JSF applications
25+ Reasons to use OmniFaces in JSF applicationsAnghel Leonard
 
eSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureeSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureAllan Huang
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJosh Juneau
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012daniel plocker
 
Dot net interview questions and asnwers
Dot net interview questions and asnwersDot net interview questions and asnwers
Dot net interview questions and asnwerskavinilavuG
 

Tendances (20)

Angularj2.0
Angularj2.0Angularj2.0
Angularj2.0
 
Jsp with mvc
Jsp with mvcJsp with mvc
Jsp with mvc
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
 
MVC 6 Introduction
MVC 6 IntroductionMVC 6 Introduction
MVC 6 Introduction
 
Jspprogramming
JspprogrammingJspprogramming
Jspprogramming
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
 
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
 
Jsf intro
Jsf introJsf intro
Jsf intro
 
Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin Sawant
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015
 
Spring MVC 3.0 Framework
Spring MVC 3.0 FrameworkSpring MVC 3.0 Framework
Spring MVC 3.0 Framework
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
25+ Reasons to use OmniFaces in JSF applications
25+ Reasons to use OmniFaces in JSF applications25+ Reasons to use OmniFaces in JSF applications
25+ Reasons to use OmniFaces in JSF applications
 
eSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureeSobi Website Multilayered Architecture
eSobi Website Multilayered Architecture
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVC
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
 
Dot net interview questions and asnwers
Dot net interview questions and asnwersDot net interview questions and asnwers
Dot net interview questions and asnwers
 

Similaire à Marlabs - ASP.NET Concepts

ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET PresentationRasel Khan
 
ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamentalldcphuc
 
ASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemSaBin SaleEm
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892Tuna Tore
 
Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008maddinapudi
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesPeter Gfader
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesAaron Jacobson
 
New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...
New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...
New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...Shahzad
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan Uzun
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introductionBhagath Gopinath
 
Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttLanvige Jiang
 

Similaire à Marlabs - ASP.NET Concepts (20)

ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamental
 
ASp.net Mvc 5
ASp.net Mvc 5ASp.net Mvc 5
ASp.net Mvc 5
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
MVC 4
MVC 4MVC 4
MVC 4
 
ASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemASP.Net | Sabin Saleem
ASP.Net | Sabin Saleem
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892
 
Mvc
MvcMvc
Mvc
 
Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008Introduction to Asp.net 3.5 using VS 2008
Introduction to Asp.net 3.5 using VS 2008
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development services
 
New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...
New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...
New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 
Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rtt
 
Asp.netmvc handson
Asp.netmvc handsonAsp.netmvc handson
Asp.netmvc handson
 
Session 1
Session 1Session 1
Session 1
 

Plus de Marlabs

Marlabs corporate deck july 2018
Marlabs corporate deck july 2018Marlabs corporate deck july 2018
Marlabs corporate deck july 2018Marlabs
 
Embracing Containers and Microservices for Future Proof Application Moderniza...
Embracing Containers and Microservices for Future Proof Application Moderniza...Embracing Containers and Microservices for Future Proof Application Moderniza...
Embracing Containers and Microservices for Future Proof Application Moderniza...Marlabs
 
Dark Web and Threat Intelligence
Dark Web and Threat IntelligenceDark Web and Threat Intelligence
Dark Web and Threat IntelligenceMarlabs
 
Cyber Threat Intelligence
Cyber Threat IntelligenceCyber Threat Intelligence
Cyber Threat IntelligenceMarlabs
 
Cognitive Computing - A Primer
Cognitive Computing - A PrimerCognitive Computing - A Primer
Cognitive Computing - A PrimerMarlabs
 
The Internet of Things : Developing a Vision
The Internet of Things : Developing a VisionThe Internet of Things : Developing a Vision
The Internet of Things : Developing a VisionMarlabs
 
Mahesh Eswar, Chief Revenue Officer at Marlabs, speaks at NJTC event, 'Breakf...
Mahesh Eswar, Chief Revenue Officer at Marlabs, speaks at NJTC event, 'Breakf...Mahesh Eswar, Chief Revenue Officer at Marlabs, speaks at NJTC event, 'Breakf...
Mahesh Eswar, Chief Revenue Officer at Marlabs, speaks at NJTC event, 'Breakf...Marlabs
 
Marlabs Capabilities Overview: Energy and Utilities
Marlabs Capabilities Overview: Energy and UtilitiesMarlabs Capabilities Overview: Energy and Utilities
Marlabs Capabilities Overview: Energy and UtilitiesMarlabs
 
Marlabs Capabilities Overview: Telecom
Marlabs Capabilities Overview: Telecom Marlabs Capabilities Overview: Telecom
Marlabs Capabilities Overview: Telecom Marlabs
 
Marlabs Capability Overview: Insurance
Marlabs Capability Overview: Insurance Marlabs Capability Overview: Insurance
Marlabs Capability Overview: Insurance Marlabs
 
Marlabs Capabilities Overview: Education and Media - Publishing
Marlabs Capabilities Overview: Education and Media - Publishing Marlabs Capabilities Overview: Education and Media - Publishing
Marlabs Capabilities Overview: Education and Media - Publishing Marlabs
 
Marlabs Capabilities Overview: Banking and Finance
Marlabs Capabilities Overview: Banking and Finance Marlabs Capabilities Overview: Banking and Finance
Marlabs Capabilities Overview: Banking and Finance Marlabs
 
Marlabs Capabilities Overview: Airlines
Marlabs Capabilities Overview: AirlinesMarlabs Capabilities Overview: Airlines
Marlabs Capabilities Overview: AirlinesMarlabs
 
Marlabs Capabilities: Healthcare and Life Sciences
Marlabs Capabilities: Healthcare and Life SciencesMarlabs Capabilities: Healthcare and Life Sciences
Marlabs Capabilities: Healthcare and Life SciencesMarlabs
 
Marlabs Capabilities: Retail
Marlabs Capabilities: Retail Marlabs Capabilities: Retail
Marlabs Capabilities: Retail Marlabs
 
Marlabs Services Capabilities Overview
Marlabs Services Capabilities OverviewMarlabs Services Capabilities Overview
Marlabs Services Capabilities OverviewMarlabs
 
Marlabs Capability Overview: Web Development, Usability Engineering Services
Marlabs Capability Overview: Web Development, Usability Engineering ServicesMarlabs Capability Overview: Web Development, Usability Engineering Services
Marlabs Capability Overview: Web Development, Usability Engineering ServicesMarlabs
 
Marlabs Capabilities Overview: QA Services
Marlabs Capabilities Overview: QA ServicesMarlabs Capabilities Overview: QA Services
Marlabs Capabilities Overview: QA ServicesMarlabs
 
Marlabs Capabilities Overview: India Professional Services
Marlabs Capabilities Overview: India Professional ServicesMarlabs Capabilities Overview: India Professional Services
Marlabs Capabilities Overview: India Professional ServicesMarlabs
 
Marlabs Capabilities Overview: Infrastructure Services
Marlabs Capabilities Overview: Infrastructure ServicesMarlabs Capabilities Overview: Infrastructure Services
Marlabs Capabilities Overview: Infrastructure ServicesMarlabs
 

Plus de Marlabs (20)

Marlabs corporate deck july 2018
Marlabs corporate deck july 2018Marlabs corporate deck july 2018
Marlabs corporate deck july 2018
 
Embracing Containers and Microservices for Future Proof Application Moderniza...
Embracing Containers and Microservices for Future Proof Application Moderniza...Embracing Containers and Microservices for Future Proof Application Moderniza...
Embracing Containers and Microservices for Future Proof Application Moderniza...
 
Dark Web and Threat Intelligence
Dark Web and Threat IntelligenceDark Web and Threat Intelligence
Dark Web and Threat Intelligence
 
Cyber Threat Intelligence
Cyber Threat IntelligenceCyber Threat Intelligence
Cyber Threat Intelligence
 
Cognitive Computing - A Primer
Cognitive Computing - A PrimerCognitive Computing - A Primer
Cognitive Computing - A Primer
 
The Internet of Things : Developing a Vision
The Internet of Things : Developing a VisionThe Internet of Things : Developing a Vision
The Internet of Things : Developing a Vision
 
Mahesh Eswar, Chief Revenue Officer at Marlabs, speaks at NJTC event, 'Breakf...
Mahesh Eswar, Chief Revenue Officer at Marlabs, speaks at NJTC event, 'Breakf...Mahesh Eswar, Chief Revenue Officer at Marlabs, speaks at NJTC event, 'Breakf...
Mahesh Eswar, Chief Revenue Officer at Marlabs, speaks at NJTC event, 'Breakf...
 
Marlabs Capabilities Overview: Energy and Utilities
Marlabs Capabilities Overview: Energy and UtilitiesMarlabs Capabilities Overview: Energy and Utilities
Marlabs Capabilities Overview: Energy and Utilities
 
Marlabs Capabilities Overview: Telecom
Marlabs Capabilities Overview: Telecom Marlabs Capabilities Overview: Telecom
Marlabs Capabilities Overview: Telecom
 
Marlabs Capability Overview: Insurance
Marlabs Capability Overview: Insurance Marlabs Capability Overview: Insurance
Marlabs Capability Overview: Insurance
 
Marlabs Capabilities Overview: Education and Media - Publishing
Marlabs Capabilities Overview: Education and Media - Publishing Marlabs Capabilities Overview: Education and Media - Publishing
Marlabs Capabilities Overview: Education and Media - Publishing
 
Marlabs Capabilities Overview: Banking and Finance
Marlabs Capabilities Overview: Banking and Finance Marlabs Capabilities Overview: Banking and Finance
Marlabs Capabilities Overview: Banking and Finance
 
Marlabs Capabilities Overview: Airlines
Marlabs Capabilities Overview: AirlinesMarlabs Capabilities Overview: Airlines
Marlabs Capabilities Overview: Airlines
 
Marlabs Capabilities: Healthcare and Life Sciences
Marlabs Capabilities: Healthcare and Life SciencesMarlabs Capabilities: Healthcare and Life Sciences
Marlabs Capabilities: Healthcare and Life Sciences
 
Marlabs Capabilities: Retail
Marlabs Capabilities: Retail Marlabs Capabilities: Retail
Marlabs Capabilities: Retail
 
Marlabs Services Capabilities Overview
Marlabs Services Capabilities OverviewMarlabs Services Capabilities Overview
Marlabs Services Capabilities Overview
 
Marlabs Capability Overview: Web Development, Usability Engineering Services
Marlabs Capability Overview: Web Development, Usability Engineering ServicesMarlabs Capability Overview: Web Development, Usability Engineering Services
Marlabs Capability Overview: Web Development, Usability Engineering Services
 
Marlabs Capabilities Overview: QA Services
Marlabs Capabilities Overview: QA ServicesMarlabs Capabilities Overview: QA Services
Marlabs Capabilities Overview: QA Services
 
Marlabs Capabilities Overview: India Professional Services
Marlabs Capabilities Overview: India Professional ServicesMarlabs Capabilities Overview: India Professional Services
Marlabs Capabilities Overview: India Professional Services
 
Marlabs Capabilities Overview: Infrastructure Services
Marlabs Capabilities Overview: Infrastructure ServicesMarlabs Capabilities Overview: Infrastructure Services
Marlabs Capabilities Overview: Infrastructure Services
 

Dernier

Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 

Dernier (20)

Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 

Marlabs - ASP.NET Concepts

  • 1. INDIA │ 9-11 February 2011 virtual techdays SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs
  • 2. INDIA │ 9-11 February 2011 virtual techdays SESSION AGENDA  A Brief Overview of ASP.MVC Concepts  Introduction  Routing, Controllers & Views  A walkthrough of new features in ASP.NET MVC 3  View Engines (Razor)  Unobtrusive Ajax and Unobtrusive Client Side Validation  Dependency resolver
  • 3. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC Classic ASP.Net - Main Features  High level abstraction over HTML / HTTP  Simplified state management  ViewState and the post‐back model  Control model  Data binding  Simple event‐driven mechanism  Simple Page Controller pattern  And lots more as well...
  • 4. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC Classic ASP.Net – Some down sides  Sub‐optimal URLs  blog.aspx?date=21032008  Form runat="server"  ViewState  Hard to test  All sorts of code in the page  Requirement to test with an HttpContext
  • 5. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC ASP.NET MVC defined  A new project‐type for VS 2010  A new routing mechanism  Applicable not just to ASP.NET MVC  Easier to write using TDD  Clean separation of concerns  NOT a replacement for existing Web Forms  Feel free to completely ignore ASP.NET MVC
  • 6. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC ASP.NET MVC defined
  • 7. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC ASP.NET MVC defined -Browser requests /Products/ -Route is determined -Controller is activated -Method on Controller is invoked -Controller processes request -Renders View, passing in custom ViewData -URLs are rendered, pointing to other Controllers
  • 8. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC Routing  Routing provides "clean" URLs  URL is mapped to a route handler  Extra level of indirection  Handlers can be changed without impacting URL  URL can be changed without impacting handler  Enables support for multilingual URLs  URL Example : http://www.mysite.com/Home/ProductList
  • 9. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC Routing  Developers adds Routes to a global RouteTable  Mapping creates a RouteData - a bag of key/values public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); } protected void Application_Start() { RegisterRoutes(RouteTable.Routes); }
  • 10. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC Controller Handling  Scenarios, Goals and Design  URLs route to controller “actions”, not pages – mark actions in Controller.  Controller executes logic, chooses view.  All public methods are accessible public void ShowPost(int id) { Post p = PostRepository.GetPostById(id); if (p != null) { RenderView("showpost", p); } else { RenderView("nosuchpost", id); } }
  • 11. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC Views  Scenarios, Goals and Design: – Are for rendering/output. • Pre-defined and extensible rendering helpers – Can use .ASPX, .ASCX, .MASTER, etc. – Can replace with other view technologies: • Template engines (NVelocity, Brail, …). • Output formats (images, RSS, JSON, …). • Mock out for testing. – Controller sets data on the View • Loosely typed or strongly typed data
  • 12. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC New Features in ASP.NET MVC 3  The Razor View Engine – Razor syntax is clean and concise, requiring a minimum number of keystrokes. – Razor is easy to learn, in part because it's based on existing languages like C# and Visual Basic. – Visual Studio includes IntelliSense and code colorization for Razor syntax. – Razor views can be unit tested without requiring that you run the application or launch a web server.
  • 13. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC New Features in ASP.NET MVC 3  Using traditional asp.net code  Using Razor
  • 14. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC New Features in ASP.NET MVC 3  New "ViewBag" Property  MVC 2 controllers support a ViewData property that enables you to pass data to a view template using a late-bound dictionary API.  In MVC 3, you can also use somewhat simpler syntax with the ViewBag property to accomplish the same purpose.  For example, instead of writing ViewData["Message"]="text", you can write ViewBag.Message="text".  You do not need to define any strongly-typed classes to use the ViewBagproperty.  Dynamic property, you can instead just get or set properties and it will resolve them dynamically at run time.
  • 15. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC New Features in ASP.NET MVC 3  New "ActionResult" Types  HttpNotFoundResult. Returns a 404 HTTP status code to the client.  RedirectResult. Returns a temporary redirect (HTTP 302 status code) or a permanent redirect (HTTP 301 status code), depending on a Boolean parameter.  HttpStatusCodeResult. Returns a user-specified HTTP status code.  JavaScript and Ajax Improvements  By default, Ajax and validation helpers in MVC 3 use an unobtrusive JavaScript approach.  Unobtrusive JavaScript avoids injecting inline JavaScript into HTML.  This makes your HTML smaller and less cluttered, and makes it easier to swap out or customize JavaScript libraries.
  • 16. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC New Features in ASP.NET MVC 3 Dependency Injection Improvements  ASP.NET MVC 3 provides better support for applying Dependency Injection (DI) and for integrating with Dependency Injection or Inversion of Control (IOC) containers. Support for DI has been added in the following areas: – Controllers (registering and injecting controller factories, injecting controllers). – Views (registering and injecting view engines, injecting dependencies into view pages). – Action filters (locating and injecting filters). – Model binders (registering and injecting). – Model validation providers (registering and injecting). – Model metadata providers (registering and injecting). – Value providers (registering and injecting).
  • 17. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC New Features in ASP.NET MVC 3 Dependency Injection Improvements  MVC 3 supports the Common Service Locator library and any DI container that supports that library'sIServiceLocator interface.  It also supports a new IDependencyResolver interface that makes it easier to integrate DI frameworks.  For more information about DI in MVC 3, see the following resources:  http://bradwilson.typepad.com/blog/2010/07/service-location-pt1-introduction.html
  • 18. INDIA │ 9-11 February 2011 virtual techdays ASP.NET MVC New Features in ASP.NET MVC 3 Other New Features  NuGet Integration  Partial-Page Output Caching  Granular Control over Request Validation  Scaffolding Improvements  Sessionless Controller Support And more..
  • 19. INDIA │ 9-11 February 2011 virtual techdays RESOURCES  Talk by Scott Hanselmann  http://channel9.msdn.com/posts/matthijs/ASPNET-MVC-2-Basics-Introduction-by-Scott- Hanselman/  Must watch to learn more about MVC  Scott Guthrie’s Blog  http://weblogs.asp.net/scottgu/archive/2010/07/27/introducing-asp-net-mvc-3-preview- 1.aspx
  • 20. THANKS│ 9-11 February 2011 virtual techdays Kamal.r@marlabs.com