ASP.NET Core MVC(一)MVC框架

本文详细解读了MVC设计模式的工作原理,从用户请求到数据展示的过程,包括Controller的请求处理、Model的数据查询和处理,以及View的HTML生成与呈现。重点介绍了浏览器请求如何通过MVC流转到最终用户界面。
摘要由CSDN通过智能技术生成

一、什么是MVC

MVC有三个基本部分-模型(model)、视图(view)和控制器(controller),它是实现应用程序的用户界面层的框架设计模式。一个典型的应用程序通常具有以下3层:

  • 用户展现层(view)
  • 业务逻辑处理层(controller)
  • 数据访问读取层(model)

二、浏览器请求响应流程
在这里插入图片描述

  • 当我们的请求到达服务器时,mvc设计模式下的controller会接收请求并且处理它
  • controller会访问model,该模型是一个类文件,会进行数据的展示
  • 除了数据本身,model还包含从底层数据源(如数据库)查询数据后的代码处理逻辑
  • 访问model完成后,controller还会继续选择view,并将model对象传递给该view
  • view仅负责呈现model的数据
  • view会根据model数据生成所需的HTML页面代码以显示model数据,简单来说就是controller提供给view学生数据
    ntroller提供给view学生数据
  • 生成的HTML页面代码通过网络发送,最终呈现在发出请求的用户的浏览器中。
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
"Learning ASP.NET Core MVC Programming" English | ISBN: 1786463830 | 2016 | EPUB | 342 pages | 17 MB Key Features Get a first-principles coverage of ASP.NET MVC and the latest release, Core This book is uniquely designed for developers who are looking to transition their skills into the .NET development field The standalone chapter structure leaves you free to explore ASP.NET MVC to immediately solve your pain points Book Description ASP.NET Core MVC helps you build robust web applications using the Model-View-Controller design. This guide will help you in building applications which can be deployed on non-windows platforms such as Linux. In today's age, it is crucial that you possess the ability to separate the programming and business logic, and this is exactly what ASP.NET Core MVC application will help you achieve. This version comes with a number of improvements that enable fast, TDD-friendly development to create sophisticated applications. You would also learn the fundamentals of Entity framework and on how to use the same in ASP.NET Core web applications. The book presents the fundamentals and philosophies of ASP.NET Core. Starting with an overview of the MVC pattern, we quickly dive into the aspects that you need to know to get started with ASP.NET. You will learn about the core architecture of model, view, and control. Integrating your application with Bootstrap, validating user input, interacting with databases, and deploying your application are some of the things that you will be able to execute with this fast-paced guide. The end of the book will test your knowledge as you build a fully working sample application using the skills you've learned throughout the book. What you will learn Get to know the concepts of ASP.NET MVC and build a new static web page using HTML, CSS, and jQuery Set up a development environment and run a sample application using the template Create a Controller with action methods Build a view using several features of the Razor View engine Construct a Model for ASP.NET Core MVC application Devise a custom mechanism to provide maximum flexibility to your application through routing Validate the user input on the client side using jQuery Enhance your applications using Bootstrap Explore new configuration and deployment scenarios—step by step guide to deploying ASP.NET Core web application in Linux
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值