ASP.NET Overview
https://msdn.microsoft.com/en-us/library/4w3ex9c2.aspx
ASP.NET is a unified统一的 Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding.
ASP.NET is part of the .NET Framework, and when coding ASP.NET applications you have access to classes in the .NET Framework.
You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic and C#.
These languages enable you to develop ASP.NET applications that benefit from the common language runtime, type safety, inheritance, and so on.
If you want to try ASP.NET, you can install Visual Web Developer Express using the Microsoft Web Platform Installer, which is a free tool that makes it simple to download, install, and service components of the Microsoft Web Platform.
These components include Visual Web Developer Express, Internet Information Services (IIS), SQL Server Express, and the .NET Framework.
All of these are tools that you use to create ASP.NET Web applications.
You can also use the Microsoft Web Platform Installer to install open-source ASP.NET and PHP Web applications.
This topic describes the following features of ASP.NET and of Visual Web Developer, the development environment for creating ASP.NET applications.
The Three Flavors of ASP.NET: Web Forms, MVC, and Web Pages
ASP.NET offers three frameworks for creating web applications: ASP.NET Web Forms, ASP.NET MVC, and ASP.NET Web Pages.
All three frameworks are stable稳定的 and mature成熟的, and you can create great web applications with any of them.
Each framework targets a different audience or type of application.
Which one you choose depends on a combination of your web development experience, what framework you’re most comfortable with, and which is the best fit for the type of application you’re creating.
All three frameworks will be supported, updated, and improved in future releases of ASP.NET.
Here's an overview of each of the frameworks and some ideas for how to choose between them.
ASP.NET Web Forms (.aspx pages)
The Web Forms framework targets developers who prefer declarative and control-based programming, such as Microsoft Windows Forms (WinForms) and WPF/XAML/Silverlight.
It offers a WYSIWYG(What You See Is What You Get) designer-driven (drag-and-drop) development model,
so it's popular with developers looking for a rapid application development (RAD) environment for web development.
If you’re new to web programming and are familiar with the traditional Microsoft RAD(apid application development) client development tools (for example, for Visual Basic and Visual C#),
you can quickly build a web application without having expertise专门知识 in HTML and JavaScript.
In particular, the Web Forms model provides the following features:
An event model that exposes events which you can program like you would program a client application like WinForms or WPF.
Server controls that render HTML for you and that you can customize by setting properties and styles.
A rich assortment分类 of controls for data access and data display.
Automatic preservation保存 of state (data) between HTTP requests, which makes it easy for a programmer who is accustomed习惯于 to client applications to learn how to create applications for the stateless web.
Web Forms works well for small teams of Web developers and designers who want to take advantage of the large number of components available for rapid application development.
In general, creating a Web Forms application requires less programming effort than creating the same application by using the ASP.NET MVC framework.
The components (the Page class, controls, and so on) are tightly integrated and usually require less code than ASP.NET MVC applications.
However, Web Forms is not just for rapid application development.
There are many complex commercial apps and app frameworks built on top of Web Forms.
Because a Web Forms page and the controls on the page automatically generate much of the markup that's sent to the browser,
you don't have the kind of fine-grained细粒的 control over the HTML that the other ASP.NET models offer.
An event-driven, control-focused model hides some of the behavior of HTML and HTTP.
For example, it's not always possible to specify exactly what markup might be generated by a control.
The Web Forms model doesn't lend提供 itself as readily容易地 as ASP.NET MVC to patterns-based development, separation of concerns, and automated unit testing.
If you want to write code factored因式分解 that way, you can; it’s just not as automatic as it is in the ASP.NET MVC framework.
The ASP.NET Web Forms MVP project shows an approach方法 that facilitates separation of concerns and testability while maintaining the rapid development that Web Forms was built to deliver.
As an example of this in action, Microsoft SharePoint is built using Web Forms MVP.
ASP.NET MVC
ASP.NET MVC targets developers who are interested in patterns and principles like test-driven development, separation of concerns, inversion of control (IoC)控制反转, and dependency injection (DI).
This framework encourages separating the business logic layer of a web application from its presentation layer.
By dividing the application into the model (M), views (V), and controllers (C), ASP.NET MVC can make it easier to manage complexity in larger applications.
With ASP.NET MVC, you can have multiple teams working on a web site
because the code for the business logic is separate from the code and markup for the presentation layer —
developers can work on the business logic while designers work on the markup and JavaScript that is sent to the browser.
With ASP.NET MVC, you work more directly with HTML and HTTP than in Web Forms.
Web Forms tends to hide some of that by mimicking模仿 the way you would program a WinForms or WPF application.
For example, Web Forms can automatically preserve state between HTTP requests, but you have to code that explicitly in MVC.
The MVC model enables you to take complete control over exactly what your application is doing and how it behaves in the web environment.
MVC was designed to be extensible, providing power developers the ability to customize the framework for their application needs.
In addition, the ASP.NET MVC source code is available under an OSI license.
MVC 4 includes a feature that helps you develop HTTP services that reach a broad range of clients, including browsers and mobile devices.
For more information, see Getting Started with ASP.NET Web API.
MVC 4 also helps you develop single-page applications (SPAs) that use client-side JavaScript for responsive client interaction.
For more information, see Single Page Application Overview.
For more information about ASP.NET MVC, see ASP.NET MVC.
ASP.NET Web Pages (.cshtml and .vbhtml files)
ASP.NET Web Pages targets developers who want a simple web development story, along the lines of PHP.
In the Web Pages model, you create HTML pages and then add server-based code to the page in order to dynamically control how that markup is rendered.
Web Pages is specifically designed to be a lightweight framework, and it's the easiest entry point into ASP.NET for people
who know HTML but might not have broad programming experience — for example, students or hobbyists.
It's also a good way for web developers who know PHP or similar frameworks to start using ASP.NET.
Like Web Forms, Web Pages is oriented toward rapid development.
Web Pages provides components called helpers that you can add to pages and that let you use just a few lines of code to perform tasks that would either be tedious or complex.
For example, there are helpers to display database data, add a Twitter feed, log in using Facebook, add maps to a page, and so on.
Web Pages provides a simpler approach than Web Forms.
If you look at a .cshtml or .vbhtml file, you can generally think of the logic as executing top-to-bottom in the file, as you would with PHP, SHTML, etc.
And because .cshtml and .vbhtml files are essentially HTML files that have additional ASP.NET code in them, they lend themselves easily to adding client-side functionality via JavaScript and jQuery.
For more information about ASP.NET Web Pages, see ASP.NET Web Pages on the ASP.NET web site.
General Notes
All three ASP.NET frameworks are based on the .NET Framework and share core functionality of .NET and of ASP.NET.
For example, all three frameworks offer a login security model based around a membership API, and all three share the same facilities for managing requests, handling sessions, and so on that are part of the core ASP.NET functionality.
In addition, the three frameworks are not entirely independent, and choosing one does not preclude排除 also using another.
For example, MVC views are often written as .cshtml or .vbhtml files (using "Razor" syntax), which means they can take advantage of some of the Web Pages features like helpers.
Since the frameworks can also coexist共存 in the same web application, it's not uncommon to see individual components of an application written using different frameworks.
For example, the bulk of a site might be written in MVC, but the data access portion of the site might be written using Web Forms because it’s such an easy framework in which to perform data access.
In these cases, the developers choose the hybrid混合的 solution that plays to their strengths and makes their lives the easiest for their particular scenarios.
As of March 28, 2012, Microsoft has placed ASP.NET MVC 4, ASP.NET Web API, and ASP.NET Web Pages v2 (Razor syntax) under the open source Apache 2.0 license.
ASP.NET Web Forms is not included.
For more information, see ASP.NET MVC, Web API, Razor and Open Source(ScottGu’s blog) and ASP.NET MVC 4, ASP.NET Web API and ASP.NET Web Pages v2 (Razor) now all open source with contributions (Scott Hanselman’s blog).
The remaining sections of this topic provide an overview of ASP.NET features that are common to all three ASP.NET frameworks or unique to Web Forms.
ASP.NET Overview的更多相关文章
- Chart For Asp.Net ----Overview
一个图表有很多元素构成,所有元素都能通过图表API控制.图表API是面向对象的,可扩展的,高复用的.支持很多图表元素如:data series,data points in a series,char ...
- ASP.NET(转自wiki)
ASP.NET是由微软在.NET Framework框架中所提供,开发Web应用程序的类库,封装在System.Web.dll文件中,显露出System.Web名字空间,并提供ASP.NET网页处理. ...
- ASP.NET 简介(转自Wiki)
ASP.NET是由微软在.NET Framework框架中所提供,开发Web应用程序的类库,封装在System.Web.dll文件中,显露出System.Web名字空间,并提供ASP.NET网页处理. ...
- ASP.NET 4 and Visual Studio 2010
https://msdn.microsoft.com/en-us/library/ee532866.aspx The topics in this section provide informatio ...
- 精彩 .NET 2015
英文原文:Understanding .NET 2015 Understanding 翻译为了解或理解,对于 .NET 来说,2015 年注定会更加精彩,所以标题就用了"精彩"这个 ...
- NET 2015
.NET 2015 英文原文:Understanding .NET 2015 Understanding 翻译为了解或理解,对于 .NET 来说,2015 年注定会更加精彩,所以标题就用了“精彩”这个 ...
- 理解 .NET 2015
去年跟着BUILD之后,我发了一篇文章Exciting Times for .NET 并从那以后我已经很荣幸地能够与.NET团队并肩作战,这其中包括了运行时.框架.语言和编译器.虽然去年我的重心已经更 ...
- [转]Using MVC 6 And AngularJS 2 With .NET Core
本文转自:http://www.c-sharpcorner.com/article/using-mvc-6-and-angularjs-2-with-net-core/ CoreMVCAngular2 ...
- ASP.NET 5概观 (ASP.NET 5 Overview)
http://www.asp.net/vnext/overview/aspnet-vnext/aspnet-5-overview ASP.NET 5概观(ASP.NET 5 Overview) 原作: ...
随机推荐
- JavaScipt30(第十八个案例)(主要知识点:Array.prototype.map)
承接上文,这是第十八个案例,中间的十到十八我直接看了答案,因为有些例子从他打开的页面看不出他要做什么. 附上项目链接: https://github.com/wesbos/JavaScript30 这 ...
- JavaScipt30(第六个案例)(主要知识点:给数字加千分号的正则)
承接上文,这是第6个案例: 附上项目链接: https://github.com/wesbos/JavaScript30 这个主要是要实现在给定的json里匹配出搜索框里的city or state, ...
- TP中U方法详解
U方法常用于ThinkPHP里的页面跳转 官方称为url组装, 就是根据某种规则组成一个url地址,这个功能就叫组装. 在ThinkPHP里,系统提供了一个封装的函数来处理url的组装,俗称U方法. ...
- 出现For input string: "" 错误
然后是因为后台生成的是一个数组,前台取的是一个对象,所以会产生这个错误 前后台交互时 mv.addObject("vo1",fhList.get(0));}将数组改成fhList. ...
- 前端安全 xss
整体的 XSS 防范是非常复杂和繁琐的,不仅需要在全部需要转义的位置,对数据进行对应的转义.而且要防止多余和错误的转义,避免正常的用户输入出现乱码. 虽然很难通过技术手段完全避免 XSS,但可以总结以 ...
- Luogu P1692 部落卫队
解题思路 数据范围不是很大,那应该不是那些普遍的图论的算法.考虑搜索,用暴力解决.从1到N枚举每一个点的位置,搜索这个点事选还是不选.如果在这个点之前选到的点中又和他冲突的点,那就不选,要么就选. 附 ...
- MySQL Docker方式安装
以5.7版本为例 1 配置mysql配置文件编辑/etc/my.cnf,添加以下内容: [mysqld] skip-host-cache skip-name-resolve datadir=/var/ ...
- django中配置允许跨域请求
对于django 安装django-cors-headers,详情请看官方文档 pip install django-cors-headers 配置settings.py文件 a.在INSTALLED ...
- 第十二节:Web爬虫之MongoDB数据库安装与数据存储
MongoDB是一个基于分布式文件存储的数据库.由C++语言编写.旨在为WEB应用提供可扩展的高性能数据存储解决方案. MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功 ...
- 【00】angular学习网站
[00] 学习资料: http://angularjs.cn/ 英文API:http://docs.angularjs.cn/api 中文API;http://www.apjs.n ...