外文翻译082501295杨君华

上传人:平*** 文档编号:15388176 上传时间:2017-11-04 格式:DOC 页数:11 大小:79.47KB
返回 下载 相关 举报
外文翻译082501295杨君华_第1页
第1页 / 共11页
外文翻译082501295杨君华_第2页
第2页 / 共11页
外文翻译082501295杨君华_第3页
第3页 / 共11页
外文翻译082501295杨君华_第4页
第4页 / 共11页
外文翻译082501295杨君华_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《外文翻译082501295杨君华》由会员分享,可在线阅读,更多相关《外文翻译082501295杨君华(11页珍藏版)》请在金锄头文库上搜索。

1、 About ASP.NET ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsofts Active Server

2、 Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language.CharacteristicsPages.NET pages, known officially as web forms, are the main building block for application development. Web forms are contained

3、 in files with an .aspx extension; in programming jargon, these files typically contain static (X)HTML markup, as well as markup defining server-side Web Controls and User Controls where the developers place all the required static and dynamic content for the web page. Additionally, dynamic code whi

4、ch runs on the server can be placed in a page within a block which is similar to other web development technologies such as PHP, JSP, and ASP, but this practice is generally discouraged except for the purposes of data binding since it requires more calls when rendering the page.Note that this sample

5、 uses code inline, as opposed to code behind.protected void Page_Load(object sender, EventArgs e) Label1.Text = DateTime.Now.ToLongDateString(); Sample pageThe current time is: Code-behind modelIt is recommended by Microsoft for dealing with dynamic program code to use the code-behind model, which p

6、laces this code in a separate file or in a specially designated script tag. Code-behind files typically have names like MyPage.aspx.cs or MyPage.aspx.vb based on the ASPX file name (this practice is automatic in Microsoft Visual Studio and other IDEs). When using this style of programming, the devel

7、oper writes code to respond to different events, like the page being loaded, or a control being clicked, rather than a procedural walk through the document.ASP.NETs code-behind model marks a departure from Classic ASP in that it encourages developers to build applications with separation of presenta

8、tion and content in mind. In theory, this would allow a web designer, for example, to focus on the design markup with less potential for disturbing the programming code that drives it. This is similar to the separation of the controller from the view in model-view-controller frameworks.ExampleThe ab

9、ove tag is placed at the beginning of the ASPX file. The CodeFile property of the Page directive specifies the file (.cs or .vb) acting as the code-behind while the Inherits property specifies the Class the Page derives from. In this example, the Page directive is included in SampleCodeBehind.aspx,

10、then SampleCodeBehind.aspx.cs acts as the code-behind for this page:using System; namespace Website public partial class SampleCodeBehind : System.Web.UI.Page protected override void OnLoad(EventArgs e) base.OnLoad(e); In this case, the Page_Load() method is called every time the ASPX page is reques

11、ted. The programmer can implement event handlers at several stages of the page execution process to perform processing.User controlsASP.NET supports creating reusable components through the creation of User Controls. A User Control follows the same structure as a Web Form, except that such controls

12、are derived from the System.Web.UI.UserControl class, and are stored in ASCX files. Like ASPX files, an ASCX file contains static HTML or XHTML markup, as well as markup defining web control and other User Controls. The code-behind model can be used.Programmers can add their own properties, methods,

13、 and event handlers. An event bubbling mechanism provides the ability to pass an event fired by a user control up to its containing page.User can also build Custom Controls for Asp.Net application. Where controls are in compiled DLL file. And by using Register directive user can use control from DLL

14、.Rendering techniqueASP.NET uses a visited composites rendering technique. During compilation, the template (.aspx) file is compiled into initialization code which builds a control tree (the composite) representing the original template. Literal text goes into instances of the Literal control class,

15、 and server controls are represented by instances of a specific control class. The initialization code is combined with user-written code (usually by the assembly of multiple partial classes) and results in a class specific for the page. The page doubles as the root of the control tree.Actual reques

16、ts for the page are processed through a number of steps. First, during the initialization steps, an instance of the page class is created and the initialization code is executed. This produces the initial control tree which is now typically manipulated by the methods of the page in the following steps.As each node in the tree is a control represented as an instance of a class, the code ma

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号