服务器控件
来源:56doc.com 资料编号:5D2641 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9A5D2641
资料介绍
服务器控件 Web开发人员要完成的最常见的任务之一是搜集、保存用户的信息。这些信息可以是简单的用户姓名和E-mail地址,也可以是用户的全部详细信息,对它们的处理不能只在浏览器上使用HTML来完成,还需要将信息传送到Web服务器进行处理或存储。 这种通过Web页面传送信息的方法称为窗体。HTML窗体包含一套控件,如文本框、复选框、下拉列表等。所有这些控件均用于从用户向服务器传送信息。此外,ASP.NET还添加了用于处理窗体的其他控件。通过这些控件,asp.NET引入了窗体控件的一些新概念。例如,可以记住在文本框中输入的文本;可以记住页面刷新前在列表框中做出的选择,直到这些数据被传送到服务器为止。 在处理用户数据的过程中,常常使用变量存储数据,并把它们从一个命令传送给另一个命令。C#是一种强类型化的语言,每个变量都有数据类型,例如字符串型、整型、日期型等。本章将介绍C#中可用的所有主要数据类型,必须给每个变量指定数据类型的原因,以及因没有指定数据类型而可能遇到的错误类型。我们还将讨论如何使用asp.NET创建功能强大的窗体,且代码量非常少,接着在变量中存储数据。 在这里主要介绍以下内容: ● 窗体 ● Web的客户机/服务器模式 ● asp.NET服务器控件或Web控件(部分) ● 变量的理论及实践 1. 窗体 窗体是WEB开发中的重点,它用于从浏览器向服务器传送数据。在介绍窗体的内部工作原理之前,首先介绍商务领域中需要使用窗体的几种情况。如果您浏览一些商务Web站点,就会发现它们的窗体通常用于相同的情况。例如: 附件二:外文翻译资料原文 Server Controls One of the most common tasks for any Web developer is collecting and storing of information from the user. It could simply be a name or an email address, but whatever be the information that you want to gather, the processing cannot be performed within the confines of HTML on the browser alone. You need to send the information to the Web server for processing or storage. Information is transmitted via Web pages by a form. HTML forms contain controls such as textboxes, checkboxes, and dropdown lists, all of which aid the passage of information from the user to the server. Moreover, ASP.NET adds its own extra controls for dealing with forms. With these, asp.NET introduces some new concepts to the control of forms, such as remembering the text that you've typed into a textbox or the selection that you have made in a listbox between page refreshes, which must be carried out on the server. During the manipulation of user data, variables are used to persist data from one command to another. C# is a strongly typed language, which means each variable has a datatype associated with it, such as string, integer, or date. This chapter will look at the main datatypes available in C# as well as the importance of assigning each variable a particular datatype and the types of errors you might encounter if you don't. We will also discuss how to use asp.NET to create powerful forms with very little programming, and then holding data in variables. We will cover: |