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】Tomcat安装及端口配置
安装环境 :Linux(CentOS 64位) 安装软件 : apache-tomcat-9.0.20.tar.gz(下载地址http://tomcat.apache.org/) 一:JDK安装配置 ...
- java学习_5_24
TreeMap底层是用红黑树实现的,源码如下: /** * A Red-Black tree based {@link NavigableMap} implementation. * The map ...
- vue学习总结(简单介绍)
声明式渲染 Vue.js 的核心是一个允许采用简洁的模板语法来声明式地将数据渲染进 DOM 的系统: <div id="app"> {{ message }} < ...
- ThinkPHP---thinkphp文件加载
[一]文件加载在ThinkPHP里提供了三种方式 实际开发里,文件加载方式一般以第一种为主(通过函数库形式自动加载,此时我们仅仅需要定义文件和函数) (1)函数库形式加载 函数库分3种级别,系统函数库 ...
- A4. JVM 内存分配及回收策略
[概述] Java 技术体系中所提倡的自动内存管理最终可以归结为自动化地解决两个问题:给对象分配内存以及回收分配给对象的内存. 对象的内存分配,往大方向讲,就是在堆上分配,对象主要分配在新生代的 Ed ...
- [转]SSD固态存储大观(一)
From: http://blog.51cto.com/alanwu/1405874 Contents 1.概述... 1 2.FusionIO:Pcie SSD的始作俑者... 2 3.Intel ...
- 再读Android sqlite
再读Android sqlite Android原生支持sqlite数据库操作,sqlite时轻量级关系型数据库,支持标准sql语句.Android对sqlite进行良好的接口封装来避免sql注入等安 ...
- 用TWaver加载大型游戏场景一例
游戏中经常会出现一些大型的户外场景,例如一个小镇.一座古城等.通常这种场景中包含了较多的建筑.道路.桥梁等等元素,其3D模型比较大且复杂.在使用TWaver加载时,可使用一些技巧,让加载速度更快.显示 ...
- C,LINUX,数据结构部分
1604期 第1期测试(面试精选:C,LINUX,数据结构部分) 本试卷从考试酷examcoo网站导出,文件格式为mht,请用WORD/WPS打开,并另存为doc/docx格式后再使用 试卷编号:24 ...
- 洛谷 4172 [WC2006]水管局长
[题解] 我们把操作倒过来做,就变成了加边而不是删边.于是用LCT维护动态加边的最小生成树就好了.同样要注意把边权变为点权. #include<cstdio> #include<al ...