Step-by-step ASP.NET MVC5 Tutorial for Beginners

Costas

Administrator
Staff member
Want to learn ASP.NET MVC 5 from scratch in a fun, step-by-step and pragmatic way?

Table of Content:

00:00 Introduction
02:48 ASP.NET MVC Architecture
05:31 Setting Up the Development Environment
07:38 Your First ASP.NET MVC 5 App
14:34 MVC in Action
21:18 Adding a Theme
26:49 Action Results
31:47 Action Parameters
37:42 Convention-based Routing
42:58 Attribute-based Routing
46:27 Passing Data to the Views
50:30 View Models
54:19 Razor Views
58:38 Partial Views

by Mosh Hamedani




Microsoft - Introduction to ASP.NET MVC - Deep Dive into Views
 

Costas

Administrator
Staff member
MVC4 vs MVC5

ASP.NET Identity
: MVC5 introduced ASP.NET Identity, which is a membership system that replaces the traditional ASP.NET Membership and Simple Membership providers. It provides more features, flexibility, and better integration with modern web development practices.

Attribute Routing: While MVC4 supports convention-based routing, MVC5 introduced attribute routing, which allows developers to define routes directly on controller actions and methods using attributes. This provides more control over the URL structure of the application and makes routing configuration more concise and readable.

Bootstrap: MVC5 included built-in support for Bootstrap, a popular front-end framework for building responsive web applications. This makes it easier for developers to create visually appealing and mobile-friendly user interfaces out of the box.

ASP.NET Web API Integration: MVC5 integrates ASP.NET Web API, making it easier to build RESTful services alongside traditional web applications. This integration simplifies the process of building applications that require both web pages and web APIs.

Dependency Injection Improvements: MVC5 introduced better support for dependency injection, making it easier to manage dependencies and write testable code by allowing constructor injection of dependencies into controllers and other components.

Attribute-based Authentication Filters: MVC5 introduced the concept of authentication filters, which are attributes that can be applied to controller actions or entire controllers to enforce authentication rules. This provides a more declarative way to secure controller actions based on the user's authentication status.

Asynchronous Controller Actions: While asynchronous controller actions were possible in MVC4, MVC5 improved support for asynchronous programming by introducing async controller actions and async support for action filters. This allows developers to write more efficient and scalable web applications by leveraging asynchronous programming patterns.

Enhanced Visual Studio Tools: MVC5 comes with enhanced tooling support in Visual Studio, including scaffolding improvements, better project templates, and integration with the latest features of Visual Studio IDE.

MVC5 vs MVC6 (aka ASP.NET Core MVC)

Cross-platform Support
: ASP.NET Core MVC is cross-platform, allowing applications to run on Windows, macOS, and Linux. MVC5 is primarily targeted for Windows environments.

Modular and Lightweight: ASP.NET Core MVC is more modular and lightweight compared to MVC5, resulting in better performance and faster startup times.

Unified MVC and Web API: MVC6 merges MVC and Web API into a single framework, simplifying the development of applications that serve both web pages and APIs. In MVC5, MVC and Web API are separate frameworks.

Dependency Injection Built-in: Dependency injection is built into ASP.NET Core MVC, making it easier to manage dependencies and write testable code. While MVC5 supports dependency injection, it requires additional setup and configuration.

New Configuration System: MVC6 introduces a new configuration system based on JSON files, environment variables, and other configuration providers. MVC5 uses the traditional web.config file for configuration.

Tag Helpers: MVC6 introduces Tag Helpers, which provide a more HTML-like syntax for working with server-side code in Razor views. MVC5 primarily relies on HTML Helpers for similar functionality.

Built-in Logging and Error Handling: ASP.NET Core MVC comes with built-in support for logging and error handling, providing a more streamlined approach compared to MVC5.

System.Web Dependency: MVC6 removes the dependency on System.Web, which was present in MVC5. This reduces overhead and simplifies development, especially for cross-platform scenarios.

ASP.NET Identity Improvements: ASP.NET Core MVC offers enhancements to ASP.NET Identity, making it more flexible and extensible compared to the authentication systems available in MVC5.
 
Top