Introduction  “M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER”. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner.

Slides:



Advertisements
Similar presentations
INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
Advertisements

Introduction to MVC Adding a View Page NTPCUG Tom Perkins, Ph.D.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
{ Model View Controller ASP.NET By Scott Crooks & Maggie Wettergreen.
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
Razor. Slide 2 Remember this? Browser Web Server HTTP Request HTTP Response (Web page / code) Client code (script) Interpret request Generate HTML and.
ASP Tutorial. What is ASP? ASP (Active Server Pages) is a Microsoft technology that enables you to make dynamic and interactive web pages. –ASP usually.
ASP MVC s/mvc-4/getting-started-with- aspnet-mvc4/intro-to-aspnet- mvc-4.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
UNIT-V The MVC architecture and Struts Framework.
Different ways to implement CSS. There are four different ways to use CSS in your web pages: – Inline CSS – Embedded CSS/Internal CSS – Linked CSS/External.
DR.JOHN ABRAHAM PROFESSOR UTPA ASP.NET. ACTIVE SERVER PAGES (ASP) Web application development environment Web applications use web browser to display.
ASP.NET INTRODUCTION INTO وزارة التربية و التعليم العالي كلية العلوم و التكنولوجيا قسم علوم الحاسوب و تكنولوجيا المعلومات اعداد الاستاذ: عبد الله محمد.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
ASP.NET and Model View Control Jesper Tørresø ITNET2 F08.
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
JavaScript: Functions © by Pearson Education, Inc. All Rights Reserved.
Introduction to ASP.NET 1www.tech.findforinfo.com.
Introduction to ASP.NET MVC Information for this presentation was taken from Pluralsight Building Applications with ASP.NET MVC 4.
CS 415 N-Tier Application Development By Umair Ashraf June 28,2013 National University of Computer and Emerging Sciences Lecture # 5 Microsoft MVC3 Architecture.
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
Universiti Utara Malaysia Chapter 3 Introduction to ASP.NET 3.5.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
Lecture Note 1: Getting Started With ASP.  Introduction to ASP  Introduction to ASP An ASP file can contain text, HTML tags and scripts. Scripts in.
Jean-Claude Trachsel Senior Consultant Trivadis AG Building a Website with ASP.NET MVC.
Jonathan Canfield Mavin Lisa Giss Professor Kenytt D. Avery
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Chapter 4: Working with ASP.NET Server Controls OUTLINE  What ASP.NET Server Controls are  How the ASP.NET run time processes the server controls on.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
Model View Controller MVC Web Software Architecture.
 Registry itself is easy and straightforward in implementation  The objects of registry are actually complicated to store and manage  Objects of Registry.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
Getting started with ASP.NET MVC Dhananjay
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
Mobile Service with.NET By – Sharad Varshney. Agenda What is it supposed to do? Goals Applications System Design Future Work / Enhancements.
1111 Creating HTML Programatically Objectives You will be able to Invoke C# code on the server from an ASP.NET page. Write C# code to create HTML.
ASP.NET – Active Server Pages ASP.NET is a server-side technology for developing web applications based on the.NET Framework.
Virtual techdays INDIA │ 9 th – 11 th January 2011 ASP.Net MVC Sundararajan S │ Associate Tech Architect, Aditi Technologies.
ASP.NET MVC An Introduction. What is MVC The Model-View-Controller (MVC) is an architectural pattern separates an application into three main components:
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
11 User Controls Beginning ASP.NET in C# and VB Chapter 8.
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
Flux & React Web Application Development Mark Repka, Rich McNeary, Steve Mueller.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Intro to MVC5 Bryan Soltis Bit-Wizards - Director of Technology & Research.
INTRODUCTION TO MVC BY SUHA MNEIMNEH. WHAT’S THE AGENDA What is MVC? MVC components MVC vs web forms vs ASP.NET vocabulary When to create MVC application.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Jim Fawcett CSE686 – Internet Programming Spring 2014
ASP.NET Essentials SoftUni Team ASP.NET MVC Introduction
Introduction to .NET Florin Olariu
An introduction to ASP.Net with MVC Nischal S
Social Media And Global Computing Introduction to The MVC Pattern
ASP MVP Web applications and Razor
Florida Gulf Coast University
Haritha Dasari Josue Balandrano Coronel -
Design and Maintenance of Web Applications in J2EE
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
ASP.NET MVC Web Development
ASP.NET MVC Imran Rashid CTO at ManiWeber Technologies.
Introduction to ASP.NET MVC
Presentation transcript:

Introduction  “M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER”. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner than the traditional ASP.NET web development.  Developing ASP.NET MVC application requires Microsoft.NET Framework 3.5 or higher.

MVC Interaction with Browser  Like a normal web server interaction, MVC application also accepts requests and responds to the web browser in the same way. User Browser MVC Architecture

The MVC model defines web applications with 3 logic layers:  The business layer (Model logic)  The display layer (View logic)  The input control (Controller logic)

Inside MVC Architecture What is a Model?  MVC model is basically a C# or VB.NET class  A model is accessible by both controller and view  A model can be used to pass data from Controller to view  A view can use model to display data in page.

Inside MVC Architecture What is a View?  View is an ASPX page without having a code behind file  All page specific HTML generation and formatting can be done inside view  One can use Inline code (server tags ) to develop dynamic pages  A request to view (ASPX page) can be made only from a controller’s action method

Inside MVC Architecture What is a Controller?  Controller is basically a C# or VB.NET class which inherits system.mvc.controller  Controller is a heart of the entire MVC architecture  Inside Controller’s class action methods can be implemented which are responsible for responding to browser OR calling views.  Controller can access and use model class to pass data to views  Controller uses ViewData to pass any data to view

MVC File Structure & File Naming Standards  MVC uses a standard directory structure and file naming standards which are a very important part of MVC application development.  Inside the ROOT directory of the application, there must be 3 directories each for model, view and Controller.  Apart from 3 directories, there must have a Global.asax file in root folder, and a web.config like a traditional ASP.NET application.  Root [directory] Controller [directory] ○ Controller CS files Models [directory] ○ Model CS files Views [directory] ○ View aspx/ascx files Global.asax Web.config

ASP.NET MVC Execution Life Cycle Browser Request (Step 1)  Browser request happens with a specific URL. Let’s assume that the user enters URL like: [xyz.com]/home/index/ Job of Global.asax – MVC routing (Step 2)  The specified URL will first get parsed via application_start() method inside Global.asax file. From the requested URL, it will parse the Controller, Action and ID.  So for [xyz.com]/home/index/:  Controller = home  Action = index()  ID = empty — we have not specified ID in [xyz.com]/home/index/, so it will consider as empty string Controller and Action methods (Step 3)  MVC now finds the home controller class in controller directory. A controller class contains different action methods,  There can be more than one action method, but MVC will only invoke the action method which has been parsed from the URL, its index() in our case.  So something like: homeController.index() will happen inside MVC controller class.  Invoking action method can return plain text string OR rendered HTML by using view. Call to View (Step 4)  Invoking view will return view(). A call to view will access the particular ASPX page inside the view directory and generate the rendered HTML from the ASPX and will respond back to the browser.  In our case, controller was home and action was index(). So calling view() will return a rendered HTML from the ASPX page located at /views/home/index.aspx.

View Engine  View Engines are responsible for rendering the HTML from your views to the browser.  Currently there are few number of view engines available for MVC and the top two view engines are 1. Razor 2. Traditional ASPX

View Engine ASPX: The syntax for writing views with this engine is the same syntax that the ASP.NET Web Forms uses and the file extensions are also taken from ASP.NET Web Form (.aspx,.ascx,.master). Example:  Sample with ASPX   Hello, the year is 

View Engine Razor:  The Razor view engine is an advanced view engine from Microsoft, packaged with MVC 3. Razor using character instead of aspx's,and the file extention would be (cshtml). Razor does not require you to explicitly close the code-block.  Razor is the best view engine available for MVC as its much cleaner and easy to write and read. Example:  Sample with Razor   the year 

Advantages of MVC  It makes it easier to manage complexity by dividing an application into the model, the view, and the controller.  It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application.  It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure.  It provides better support for test-driven development (TDD).  It works well for Web applications that are supported by large teams of developers and for Web designers who need a high degree of control over the application behavior.

Disadvantages of MVC  It is too complex to implement  It is not suitable for smaller application, implementing this pattern in such applications will have adverse effects in the application's performance and design.