Asp.Net MVC Conventions

Slides:



Advertisements
Similar presentations
Citavi – Attaching Ebook Chapters from EBSCOhost to Reference Records.
Advertisements

RightNow 8 -- Adding a new report: New > Report: ORAnalytics > Reports > New Report
RightNow February Adding a New Report: RN icon > Report: OR Analytics > Reports > New Report
The Librarian Web Page Carol Wolf CS396X. Create new controller  To create a new controller that can manage more than just books, type ruby script/generate.
Introduction to MVC Adding a View Page NTPCUG Tom Perkins, Ph.D.
Introduction to MVC Action Methods, Edit View, and a Search Feature NTPCUG Dr. Tom Perkins.
Access Lesson 2 Creating a Database
1 Chapter 12 Working With Access 2000 on the Internet.
2015/6/301 TransCAD Managing Data Tables. 2015/6/302 Create a New Table.
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Collaborating with Outlook 2002 and Exchange 2000.
Business Optix Library Service – Workflow
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute.
BIT 286: Web Applications Lecture 04 : Thursday, January 15, 2015 ASP.Net MVC - Models.
Mail merge letters are used to send the same or similar documents to many different people. Since they contain the recipient’s name, address, and other.
XP Chapter 2 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Building The Database Chapter 2 “It is only the farmer.
Introduction to ASP.NET MVC Information for this presentation was taken from Pluralsight Building Applications with ASP.NET MVC 4.
1 By: Nour Hilal. Microsoft Access is a database software where data is stored in one or more Tables. A Database is a group of related Tables. Access.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
Working with GridView Control: Adding Columns. Adding Buttons to a Bound GridView: 1. Drag the WebProduct table from Data connection to a page 2. Demo.
Fourth R Inc. 1 WELCOME TO MICROSOFT OFFICE OUTLOOK 2003 INTRODUCTORY COURSE.
BIT 286: Web Applications Lecture 10 : Thursday, February 5, 2015 ASP.Net Form Submission.
ASP.NET MVC The Basic Big Picture Juhani Välimäki
What is Web Site Administration Tool ? WAT Allow you to Configure Web Site With Simple Interface –Manage Users –Manage Roles –Manage Access Rules.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 3 – Creating and Modifying Forms.
Getting started with ASP.NET MVC Dhananjay
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
MS Access and Database Connections. Pre-work To make our program work seamlessly, first we have to make a small change on the database table.
HCI Prototype Presentation by Richard Gerard Gator Growlers CEN4020.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
NAMI 360 – Screenshot Guide 1 Organization Profile.
22 Copyright © 2009, Oracle. All rights reserved. Filtering Requests in Oracle Business Intelligence Answers.
Entity Framework Database Connection with ASP Notes from started/getting-started-with-ef-using-mvc/creating-an-
BIT 286: Web Applications Lecture 04 : Thursday, January 15, 2015 ASP.Net MVC -
BIT 286: Web Applications ASP.Net MVC. Objectives Applied MVC overview Controllers Intro to Routing Views ‘Convention over configuration’ Layout files.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Form Submission And Saving Data To.
MVC Controllers TestsMigrations Ye Olde Internet Model DB Server Router View Browser Today’s focus Controller.
Jim Fawcett CSE686 – Internet Programming Summer 2010
Jim Fawcett CSE686 – Internet Programming Spring 2014
Web-based Information Science Education
Asp.Net MVC Conventions
Android Content Providers & SQLite
An introduction to ASP.Net with MVC Nischal S
About the To-Do Bar in Outlook
Creating Oracle Business Intelligence Interactive Dashboards
Jim Fawcett CSE686 – Internet Programming Spring 2012
Social Media And Global Computing Managing Databases with MVC
Web Design and Development
Microsoft Office Illustrated Fundamentals
View In MVC Mo Rezai.
Controllers.
ServiceLink Training Video Entering Job Referral Outcomes
Access Lesson 2 Creating a Database
Social Media And Global Computing Managing MVC with Custom Models
MS Access and Database Connections
WORKING WITH SHARED DOCUMENTS
Chapter 7 Searching Your Products
Creating and Managing Database Tables
Lecture 5: Functions and Parameters
Request Form You gain access to the Request Form from your intranet set-up by your IT dept. Or the internet via either our desktop launcher icon. Or a.
Click on Save All to save everything and choose a location etc
Presenter’s Notes: 2005 Edition.
MVC Controllers.
MVC Controllers.
MVC Controllers.
Automation and IDispatch
Share & View Functions of Portfolio
3.3 – Invoke Workflow File Exercise 3.2: Extract as Workflow
Presentation transcript:

Asp.Net MVC Conventions Jim Fawcett CSE686 – Internet Programming Spring 2019

Asp.Net Conventions The MVC framework uses three kinds of conventions: Structure conventions Model structure Directory structure Naming conventions Controller methods & views Placement conventions

Model Structure Models are C# classes All models reside in ./Models folder Have public properties Controller methods may name a model When controller method is invoked it is passed an instance of model named as its method argument Views can be typed to use a specific model Model’s public properties are populated on postback if their names match names used in the view.

Naming Conventions Default controller is HomeController.cs Controller names end in Controller Default controller defined in Startup.Configure method Default view is Index.cshtml Controller methods are names of views Public ActionResult Index() { … }

Placement Conventions Controllers are placed in folder Controllers Views are placed in subfolder named with controller name: ./Views/Home/Index.cshtml All models are placed in folder named Models

Adding a New Controller Right-click on Controllers folder and select Add Controller You can elect to add “Create”, “Update”, and “Details” controller methods Action methods often return a view using the controller method View(). If no arguments will return view of same name as method You can supply names of both a view and a model to be used.

Adding New View Right-click on controller’s action method name and select Add View You can now elect to make the view strongly typed by selecting an existing model (the Add View dialog calls that “View Data Class”) You can elect to select View Content: Create, Delete, Details, Edit, List List, for example, provides a nicely structured table presentation of records from your model

Passing Data to Controller Controllers are created with each call So you can’t save data in controller method from call to call You can save data in ViewData dictionary or in Session. Often you save all your data in a database. When a controller method is called any model arguments are passed newly created instances of the named model. On PostBack data from view is bound to model

Passing Data to a View There are two main ways of getting data from a controller method to its view: Add data to ViewData dictionary, shared by controller and view Pass model as argument of controller method View(aModel)

Returning Data from View Controller methods receive data in several ways: A get request (from an ActionLink) may send an index into a model list. A PostBack (post request) sends its form data back to the Asp.Net Request Dictionary. PostBack data is automatically bound to the view model held by the method if the view is strongly typed.

That’s All Folks!