Systems Development with ASP.NET MVC
Author(s): Thom Luce
Edition: 1
Copyright: 2021
Pages: 362
Choose Your Platform | Help Me Choose
This book is intended for use with a system’s development project in a capstone MIS/IS course. The book is logically divided into two major sections. The first section starts by reviewing basic HTML and CSS web page development and then introduces Microsoft’s ASP.NET MVC development environment through creation of a simple, non-database application. Because the introduction doesn’t include a database, only controllers and views are initially discussed. Models are introduced in the next chapter and a database is created using the Entity Framework Code First approach. This is followed by a more detailed discussion of controllers and views with scaffolding to support the data models. Next, the book looks at web page formatting using Bootstrap 3. The final chapter in this part of the book looks at the use of data annotations and data validation.
The second part of the book starts by developing a more complex data model and building the controllers and views to support it. The chapter considers various modifications to the page layout view and simple customizations to views. The chapter ends with an introduction to GitHub as a version control and backup tool. The next chapter discusses the implementation of Microsoft Identity and the implementation of various security measures related to it. The next several chapters cover methods for uploading documents, including images, approaches to sorting, paging and searching on pages, an approach to sending email messages from a running page and the implementation of third party addons, specifically one that allows the end user to enter formatted text on a web page. The section ends with chapters discussing the implementation and use of partial views, using Linq and Lambda expressions to control data access and Routing to control access to pages. There is also a brief description of two techniques for publishing a web site in an appendix.
This book is not designed to replace systems analysis and design textbooks but is intended for use in those classes looking to demonstrate system analysis and design principles though implementation of larger scale development projects. The modular nature of MVC works well with the Scrum approach to development where early Sprints focus on initial requirements, data models and initial design issues and later Sprints refining the requirements.
To aid this approach the book introduces a series of scenarios in early chapter exercises (a regional air carrier, a sports club, a veterinary clinic and a company wanting to do internet sales) and exercises at the end of each subsequent chapter built on these scenarios.
CHAPTER 1
In the Beginning
HTML
Styling and Cascading Style Sheets
CSS Box Model
Style Sheets
Summary
Exercises
CHAPTER 2
Introduction to Web Development with Microsoft Visual Studio
ASP.NET MVC
Creating Our First Default ASP.NET MVC Application
The Basic Structure of an MVC project
Basic MVC Operation
The Home Controller
The MVC Layout View
Customization and Personalization
Summary
Exercises
CHAPTER 3
Creating Models with the Entity Framework Code First
Introduction
Creating Models
Sample Webpages Using Pilot and Flight
Many-to-Many Models in Entity Framework
Sample Web Pages Using Pilot—Crew—Flight Models
Problems That Occur When You Change a Data Model
Summary
Exercises
CHAPTER 4
MVC with Models –Scaffolding Controllers, Views and Customizing Views
Controllers
The Structure of a Controller
Summary
Exercises
CHAPTER 5
Formatting with Bootstrap
Bootstrap Grid System
Bootstrap Styling of Text and Headings
Bootstrap Styling of Tables
Wells and Alerts
Buttons
Overriding Bootstrap Styling
Summary
Exercises
CHAPTER 6
Data Annotations and Validation
Fixing What Is Displayed
Data Annotations
DataType Attribute
Data Validation
Summary
Exercises
CHAPTER 7
Creating and Using More Advanced Data Models
Introduction
Models
Source Control with GitHub
Creating Controllers and Views for the New Models
Creating Hyperlinks and Menu Buttons with @HTML.ActionLink
Modifying Page Layout
Making the Views More User Friendly
Summary
Exercises
CHAPTER 8
Using Microsoft Identity to Implement Security
Introduction
Registering Users
Authentication and Authorization
So, What Is Wrong With This?
Adding a Finer Level of Control
Who is in the Admin Role?
Finally, GitHub, Again
Summary
Exercises
CHAPTER 9
Uploading and Linking Images and Other Documents
Introduction
Single File Processing
Uploading and Linking Other File Types
Creating a Carousel of Uploaded Images
Uploading More Than One Image At a Time
Summary
Exercises
CHAPTER 10
Sorting, Searching, Sending E-mail, and Third-Party Improvements
Sorting
Paging
Searching
Column Sorting
Entering Formatted Text
Using an API Key
Sending E-mail from an MVC Application
Summary
Exercises
CHAPTER 11
Using Partial Views
Introduction
Using Partial Views to Solve Programming Problems
Using Two Partial Views
Summary
Exercises
CHAPTER 12
Using Linq and Lambda Expressions
Debugging Query Operations
Common Linq Expressions for LocatingRecords
Common Linq Expressions Returning Scalar Values: count, min, max, average, sum
OrderBy, ThenBy, OrderByDescending, and ThenByDescending
First, FirstOrDefault, Last, LastOrDefault
Take, Skip, TakeWhile, and SkipWhile
Summary
Exercises
CHAPTER 13
Routing
RouteConfig.cs
Global.asax
Customizing Routes
Using a Route to Shorten a URL
Using a Route to Speed Searching
Combining Controller and Action Into One Command
Multilevel Searches with Routing
Routes With Dates
Summary
Exercises
APPENDIX 1
SQL Script to Generate ASP.NET Membership Tables
APPENDIX 2
Publishing a Website
Thom Luce has an A.B. in Bacteriology from Ohio Wesleyan University, an M.S. in Molecular Biology from Purdue University and a Ph.D. in Science Education from Purdue completing a dissertation related to computer assisted instruction in 1976. After completing graduate studies at Purdue, he moved to West Texas where he taught Biology at Midland College for two years and then went to work for a small company following his real passion, computers. He then spent eight years teaching electronic data processing and computer information systems at Odessa College in Odessa, Texas. In 1987 Professor Luce and family moved to Ohio University to join the Computer Systems in Business interest group of the Management Systems department. This group later split from the Management department to form the Management Information Systems department, now known as the Analytics and Information Systems Department.
Professor Luce has served as a visiting professor at the Institute Technology MARA (ITM) (now known as UiTM - the University Teknologi MARA) in Malaysia, Chubu University in Japan and spent almost three years as the on-site MBA coordinator for the Ohio University College of Business at ITM in Malaysia. He also taught several times in College of Business MBA programs in Bangalore, India and served as a member of the instructional delivery team for two intakes of the Ohio University MBA Without Boundaries (MBA-WB) program. Professor Luce served as director of the MBA-WB program from 2001-2004. Luce has participated in numerous GCP (Global Consulting Project) and JSCP (Joint Student Consulting Project) summer programs taking undergraduate and graduate business students to South Africa, Brazil, Argentina, Malaysia, India, China, Hungary, Spain, Greece and France. He served a four-year team as Chair of the MIS department starting in July of 2009 and a two-year term as interim Chair from 2015-2017.
Professor Luce has published several textbooks and was an instructor numerous times at the National Computer Educators Institute. His research interests are primarily in the areas of MIS education and the use of technology to improve business education. He teaches a number of different courses within the MIS department with primary focus on the systems development courses, computer application courses (specifically Internet based applications using tools such as MS SQL Server, ASP.NET, C#.NET, and ASP.NET MVC) and recently converted his capstone live-client project course to use the Agile Scrum approach to system's development.
In addition to his work in the AIS Department, Professor Luce served a long term as Chair of the University International Council and as a member of the Ohio University Senior International Management Team. He currently serves as Vice Chair of the Ohio University Credit Union Board of Directors and previously completed an eight year term on the Executive Board of the International Association for Computer Information Systems
This book is intended for use with a system’s development project in a capstone MIS/IS course. The book is logically divided into two major sections. The first section starts by reviewing basic HTML and CSS web page development and then introduces Microsoft’s ASP.NET MVC development environment through creation of a simple, non-database application. Because the introduction doesn’t include a database, only controllers and views are initially discussed. Models are introduced in the next chapter and a database is created using the Entity Framework Code First approach. This is followed by a more detailed discussion of controllers and views with scaffolding to support the data models. Next, the book looks at web page formatting using Bootstrap 3. The final chapter in this part of the book looks at the use of data annotations and data validation.
The second part of the book starts by developing a more complex data model and building the controllers and views to support it. The chapter considers various modifications to the page layout view and simple customizations to views. The chapter ends with an introduction to GitHub as a version control and backup tool. The next chapter discusses the implementation of Microsoft Identity and the implementation of various security measures related to it. The next several chapters cover methods for uploading documents, including images, approaches to sorting, paging and searching on pages, an approach to sending email messages from a running page and the implementation of third party addons, specifically one that allows the end user to enter formatted text on a web page. The section ends with chapters discussing the implementation and use of partial views, using Linq and Lambda expressions to control data access and Routing to control access to pages. There is also a brief description of two techniques for publishing a web site in an appendix.
This book is not designed to replace systems analysis and design textbooks but is intended for use in those classes looking to demonstrate system analysis and design principles though implementation of larger scale development projects. The modular nature of MVC works well with the Scrum approach to development where early Sprints focus on initial requirements, data models and initial design issues and later Sprints refining the requirements.
To aid this approach the book introduces a series of scenarios in early chapter exercises (a regional air carrier, a sports club, a veterinary clinic and a company wanting to do internet sales) and exercises at the end of each subsequent chapter built on these scenarios.
CHAPTER 1
In the Beginning
HTML
Styling and Cascading Style Sheets
CSS Box Model
Style Sheets
Summary
Exercises
CHAPTER 2
Introduction to Web Development with Microsoft Visual Studio
ASP.NET MVC
Creating Our First Default ASP.NET MVC Application
The Basic Structure of an MVC project
Basic MVC Operation
The Home Controller
The MVC Layout View
Customization and Personalization
Summary
Exercises
CHAPTER 3
Creating Models with the Entity Framework Code First
Introduction
Creating Models
Sample Webpages Using Pilot and Flight
Many-to-Many Models in Entity Framework
Sample Web Pages Using Pilot—Crew—Flight Models
Problems That Occur When You Change a Data Model
Summary
Exercises
CHAPTER 4
MVC with Models –Scaffolding Controllers, Views and Customizing Views
Controllers
The Structure of a Controller
Summary
Exercises
CHAPTER 5
Formatting with Bootstrap
Bootstrap Grid System
Bootstrap Styling of Text and Headings
Bootstrap Styling of Tables
Wells and Alerts
Buttons
Overriding Bootstrap Styling
Summary
Exercises
CHAPTER 6
Data Annotations and Validation
Fixing What Is Displayed
Data Annotations
DataType Attribute
Data Validation
Summary
Exercises
CHAPTER 7
Creating and Using More Advanced Data Models
Introduction
Models
Source Control with GitHub
Creating Controllers and Views for the New Models
Creating Hyperlinks and Menu Buttons with @HTML.ActionLink
Modifying Page Layout
Making the Views More User Friendly
Summary
Exercises
CHAPTER 8
Using Microsoft Identity to Implement Security
Introduction
Registering Users
Authentication and Authorization
So, What Is Wrong With This?
Adding a Finer Level of Control
Who is in the Admin Role?
Finally, GitHub, Again
Summary
Exercises
CHAPTER 9
Uploading and Linking Images and Other Documents
Introduction
Single File Processing
Uploading and Linking Other File Types
Creating a Carousel of Uploaded Images
Uploading More Than One Image At a Time
Summary
Exercises
CHAPTER 10
Sorting, Searching, Sending E-mail, and Third-Party Improvements
Sorting
Paging
Searching
Column Sorting
Entering Formatted Text
Using an API Key
Sending E-mail from an MVC Application
Summary
Exercises
CHAPTER 11
Using Partial Views
Introduction
Using Partial Views to Solve Programming Problems
Using Two Partial Views
Summary
Exercises
CHAPTER 12
Using Linq and Lambda Expressions
Debugging Query Operations
Common Linq Expressions for LocatingRecords
Common Linq Expressions Returning Scalar Values: count, min, max, average, sum
OrderBy, ThenBy, OrderByDescending, and ThenByDescending
First, FirstOrDefault, Last, LastOrDefault
Take, Skip, TakeWhile, and SkipWhile
Summary
Exercises
CHAPTER 13
Routing
RouteConfig.cs
Global.asax
Customizing Routes
Using a Route to Shorten a URL
Using a Route to Speed Searching
Combining Controller and Action Into One Command
Multilevel Searches with Routing
Routes With Dates
Summary
Exercises
APPENDIX 1
SQL Script to Generate ASP.NET Membership Tables
APPENDIX 2
Publishing a Website
Thom Luce has an A.B. in Bacteriology from Ohio Wesleyan University, an M.S. in Molecular Biology from Purdue University and a Ph.D. in Science Education from Purdue completing a dissertation related to computer assisted instruction in 1976. After completing graduate studies at Purdue, he moved to West Texas where he taught Biology at Midland College for two years and then went to work for a small company following his real passion, computers. He then spent eight years teaching electronic data processing and computer information systems at Odessa College in Odessa, Texas. In 1987 Professor Luce and family moved to Ohio University to join the Computer Systems in Business interest group of the Management Systems department. This group later split from the Management department to form the Management Information Systems department, now known as the Analytics and Information Systems Department.
Professor Luce has served as a visiting professor at the Institute Technology MARA (ITM) (now known as UiTM - the University Teknologi MARA) in Malaysia, Chubu University in Japan and spent almost three years as the on-site MBA coordinator for the Ohio University College of Business at ITM in Malaysia. He also taught several times in College of Business MBA programs in Bangalore, India and served as a member of the instructional delivery team for two intakes of the Ohio University MBA Without Boundaries (MBA-WB) program. Professor Luce served as director of the MBA-WB program from 2001-2004. Luce has participated in numerous GCP (Global Consulting Project) and JSCP (Joint Student Consulting Project) summer programs taking undergraduate and graduate business students to South Africa, Brazil, Argentina, Malaysia, India, China, Hungary, Spain, Greece and France. He served a four-year team as Chair of the MIS department starting in July of 2009 and a two-year term as interim Chair from 2015-2017.
Professor Luce has published several textbooks and was an instructor numerous times at the National Computer Educators Institute. His research interests are primarily in the areas of MIS education and the use of technology to improve business education. He teaches a number of different courses within the MIS department with primary focus on the systems development courses, computer application courses (specifically Internet based applications using tools such as MS SQL Server, ASP.NET, C#.NET, and ASP.NET MVC) and recently converted his capstone live-client project course to use the Agile Scrum approach to system's development.
In addition to his work in the AIS Department, Professor Luce served a long term as Chair of the University International Council and as a member of the Ohio University Senior International Management Team. He currently serves as Vice Chair of the Ohio University Credit Union Board of Directors and previously completed an eight year term on the Executive Board of the International Association for Computer Information Systems