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) 原作: ...
随机推荐
- Linux的网卡由eth0变成了eth1或eth2,如何修复??
背景:做linux下分布式测试的时候,重新安装了两个linux虚拟机,结果分布式脚本没有做好,分布式也没有做成. 今天想练练linux命令,打开vmware,启动linux1 虚拟机,使用ifconf ...
- sql IIF函数的应用
工作中由于用各种框架,业务也不是很复杂,一直没怎么写过复杂的sql,今天写了一个 数据如下 代码如下 Sub 班级分数等级分析(shname) Dim Con As Object, rs As Obj ...
- Vue指令的概念
指令(Directives) 是带有v- 前缀的特殊属性,指令属性是单一的js表达式. 指令的职责就是表达式的值发生变化时,在DOM中做出相应的回应. 如下例子: 实例 <div id=&quo ...
- HTML `capture` 属性
file 类型的 <input> 除了调起系统的文件选择框外,还可通过指定 capture 属性来现场拍照或录制.配合 accept 属性,可实现更加便捷的文件获取. 比如想要录制一段视频 ...
- Compute和Linq的Field使用
目录: Compute的使用 Field的使用 1.Compute 案例: private void ComputeBySalesSalesID(DataSet dataSet) { // Presu ...
- 在MONO Design中使用Flex3D
在项目开发组的努力下,HTML5 3D 的开发包变得越来越优秀,越来越健壮:基于HTML5 3D技术的MONO Design建模平台功能也变得越来越强大和完善,这个方便了很多使用我们HTML5 3D的 ...
- swift中tableview的使用和注意事项
今天使用swift写了个简单的tableView,语法和用法上跟oc没多大的区别.但是还是有一些细节的地方需要注意一下的. 先上代码 import UIKit class ViewController ...
- Tornado进阶
三.Tornado进阶 3.1 Application settings debug,设置tornado是否工作在调试模式,默认为False即工作在生产模式.当设置debug=True 后,torna ...
- Python-组合数据类型
集合类型及操作 >集合类型定义 集合是多个元素的无序组合 -集合类型与数学中的集合概念一致 -集合元素之间无序,每个元素唯一,不存在相同元素 -集合元素不可更改,不能是可变数据类型 -集合用大括 ...
- 泛型约束 ---类型参数上的限制(where T:class,new())
今天遇到的一个问题,找到了解决办法,收藏以后记得看一下!