首页 >  免费外文翻译  > 正文

asp.net毕业设计外文翻译

附录B: 外文翻译-译文
如何使用ASP.NET
  我们要开启一个新的ASP.NET WEB 应用程序项目,缺省的项目标题是WebApplication1.缺省网址是http://localhost.事实上项目被分为两部分,一部分位于Web服务器的根目录(inetpub/wwwroot),另一部分位于MyDocuments目录下的visual studio Projects子目录。
  Visual Studio以ASP.NET的Design view(设计视图,一个拖放式设计器)开启项目,另外我们也可以在HTML编辑器中显示这一页面。单击显示页面的左下角的Design按钮或HTML按钮,便可在两种视图来回切换。
  缺省情况下,新建的第一个页面被命名为WebForm1.aspx(ASP.NET页面后缀名为.aspx;早期的ASP页面的后缀是.asp)。如果想更改页面名字,请开启Properties窗口,单击下拉菜单中的WebForm1,修改Name property。类似情况,如果要修改某控件的缺省名称,请单击Properties的下拉菜单中的某个控件(你的修改目标),并修改其ID property。
  缺省情况下,Solution Explorer(解决方案资源管理器)窗口并不显示每个页面背后的C#代码文件,要想见到这些文件,必须先点击Solution Explorer的Show All Files(显示所有文件)图标。这时WebForm1.aspx和Global.asax文件的右侧会各自出现一个开展符(+)。点击其上的’+’符号,便可显示C#文件:WebForm1.aspx.cs和Global.asax.cs。当然,双击其中任一文件,就会在Text display(查看文本)窗口中开启该文件。
 开始编写程序之前,我们先运行一下空项目。运行时应该弹出一个空白的浏览器页面,浏览器标题栏应该显示此页面的URL路径。我们就从这里开始着手。
 在Windows Forms中,Form class代表窗口抽象性(window abstraction)。我们可以为它添加控件、设置标题等等。我们自己的class派生自Form class。缺省情况下我们的class被命名为Form1,例如: 
      Public class Form1:System.Windows.Forms.Form
 我们(通过设计器)所添加的控件和callback函数,将成为Form1 class的成员。 Web Forms的工作模型十分类似。例如Page class代表我们设计的页面(page),我们的class派生自Page class,缺省情况下这些class被命名为WebForm1,例如:
       Public class WebForm1:System.Web.UI.Page
 我们添加的控件和callback函数,将成为WebForm1 class的成员。Page class也有自己的public和protected成员。
一般文档的Properties窗口(亦即Properties窗口中的DOCUMENT项)可以设置页面显示(外观)特征,例如页面背景色(bgColor)与背景图片(background)。浏览器标题栏的文本可通过title property来设置。页面中的文本颜色可通过text property来设置。页面中的链接(links)颜色可通过link(来访问链接)、vLink(已访问链接)、aLink(当前链接)等properties来设置。
 我们必须作出的一个重要决定是,到底是将pageLayOut property设为GridLayout还是FlowLayout。前者表示控件位置以x/y坐标表示,后者表示控件位置依照objects的相对大小和形状,自页顶向页尾分布。
 文档(document)有30个以上的相关属性(properties)。只要单击其中一个,Properties窗口底部就会出现该属性的简短描述,一如Windows Forms那般,每当我们设置某个属性时,设计器就会修改下方的HTML文本,反映我们的更动。如果要一点一点的观察这些更动,请在设置某个属性(Properties)或添加某个控件时,来回切换页面的Design view和HTML view。
理解页面事件(Page Event)的生命周期
 当用户与Web Form打交道时,客户端就会发生各种events(事件)。这些events将被捕获。而后,它们要么“通过HTTP post直接返回Web服务器”,要么“暂存(cache)起来直到触发某个post才返回服务器“。Events的处理动作实际上是在服务器进行的。处理完毕后,修改过的页面再被翻译为HTML代码,并流回客户端以供显示。
 
    .............................................此处省略若干字
 
 
 
附录A: 外文翻译-原文
How to use the ASP.NET
     We’ll open a new ASP.NET Web application project. By default the project title is WebApplication1.The default location is displayed as http://localhost. Physically, the project is divided between the server’s Web content root(inetpub/wwwroot)and the Visual Studio Projects directory under MyDocuments.
     Visual Studio opens the project in the Design view of the ASP.NET page. This is the drag-and-drop designer view. Alternatively ,we can display the page within the HTML editor. We can toggle between the two views by clicking the Design or HTML button at the left-hand bottom corner of the page display.
     By default, the page is named WebForm1.aspx.(An ASP.NET page ends in.aspx; the pages of its ASP predecessor end in.asp) To change its name, open the Properties window, click on WebForm1 in the drop-down control menu, and change the Name property entry.(Similarly, to change the default name of a control, click on its entry in the Properties drop-down control menu and change the control’s ID property entry.)
     By default, the Solution Explorer window does not show the code-behind C# file associated with each page. To see these files, we need to first click on appears beside the WebForm1.aspx and Golbal.asax files. Clicking on the + sign displays the C# files WebForm1.aspx.cs and Global.asax.cs. Double-Clicking either file, of course, opens it within the text display window.
     Before we begin out implementation, let’s execute the empty project. Your browser should pop up with a blank page. The browser’s title bar should print the page’s URL path, which is what we start with.
     In Windows Forms, the Form class represents the window abstraction. We add controls to it ,we give it a title, and so on. Our class is derived from the Form class. By default ,it is called Form1-for example,
     Public class Form1:System.Windows.Forms.Form
     Added controls and callbacks become members of the Form1.class.Web Forms works on a very similar model. For example, the Page class represents the page we design. Our class is derived from the Page class. By default, it is called WebForm1-for example,
     Public class WebForm1:System.Web.UI.Page
     The controls and callbacks we introduce become members of the WebForm1 class. The public and protected Page class members are available as well.
     The Properties window of the general document, refered to as DOCUMENT within the Properties window, allow us to set up the display characteristics of the page, such as its background color ( bgColor ) or whether to title a background image (background).The text of the browser’s title bar is set through the text property .The color of any text appearing on the page is set through the text property. The color of page links is set through the link (unvisited links), vLink (visited links), and aLink (active links) properties.
     One of the important decisions is whether to set the pageLayout property to GridLayout(the location of the controls are at fixed x/y coordinates) or FlowLayout (the control’s location flows from the top to the bottom of the page according to the relative sizes and shapes of the objects).
     Over 30 properties are associated with the document. Clicking on a property displays a short description of it at the bottom of the Properties page, the same as under Windows Forms .Each time we set a property ,the underlying HTML text is modified to reflected our change. To incrementally view the changes, toggle between the design and HTML views of the page as you set or reset a property, add a control, and so on.
 

以上是本题目部分介绍,若需要完整版或不符合您的要求,请联系客服微信:ztopmind  > 或者加QQ 840612233

上一篇:jsp外文翻译之Java框架构建Web应用

下一篇:asp.net数据挖掘外文翻译带出处