ASP.NET Technique 1. Building ASP.NET Pages ASP.NET and the .NET Framework ASP.NET is part of Microsoft's overall .NET framework, which contains a vast set of programming classes designed to satisfy any conceivable programming need. 39914
The .NET Framework Class Library
For example, for each language, you would have to include methods for accessing the file system, working with databases, and manipulating strings.
Furthermore, these languages contain similar programming constructs. Every language, for example, can represent loops and conditionals. Even though the syntax of a conditional written in Visual Basic differs from the syntax of a conditional written in C++, the programming function is the same.
Finally, most programming languages have similar variable data types. In most languages, you have some means of representing strings and integers.
The .NET Framework Class Library does exactly that. It consists of a vast set of classes designed to satisfy any conceivable programming need. For example, the .NET framework contains classes for handling database access, working with the file system, manipulating text, and generating graphics. In addition, it contains more specialized classes for performing task such as working with regular expressions and handling network protocols.
The .NET framework, furthermore, contains classes that represent all the basic variable data types such as strings, integers, bytes, characters, and arrays.
Standard ASP.NET Namespaces
The classes contained in a select number of namespaces are available in your ASP.NET pages by default. (You must explicitly import other namespaces.) These default namespaces contain classes that you use most often in your ASP.NET applications:
System— Contains all the base data types and other useful classes such as those related to generating random numbers and working with dates and times.
System.Collections— Contains classes for working with standard collection types such as hash tables, and array lists.
System.Collections.Specialized— Contains classes that represent specialized collections such as linked lists and string collections.
System.Configuration— Contains classes for working with configuration files (Web.config files).
System.Text— Contains classes for encoding, decoding, and manipulating the contents of strings.
System.Text.RegularExpressions— Contains classes for performing regular expression match and replace operations.
Introducing ASP.NET Controls
ASP.NET controls provide the dynamic and interactive portions of the user interface for your Web application. The controls render the content that the users of your Web site actually see and interact with. For example, you can use controls to create HTML form elements, interactive calendars, and rotating banner advertisements.
ASP.NET controls coexist peacefully with HTML content. Typically, you create the static areas of your Web pages with normal HTML content and create the dynamic or interactive portions with ASP.NET controls.
The best way to understand how ASP.NET controls work in an HTML page is to look at a simple Web Forms Page.
Adding Application Logic to an ASP.NET Page
The second building block of an ASP.NET page is the application logic, which is the actual programming code in the page. You add application logic to a page to handle both control and page events.
If a user clicks a Button control within an HTML form, for example, the Button control raises an event (the Click event). Typically, you want to add code to the page that does something in response to this event. For example, when someone clicks the Button control, you might want to save the form data to a file or database.
Controls are not the only things that can raise events. An ASP.NET page itself raises several events every time it is requested. For example, whenever you request a page, the page's Load event is triggered. You can add application logic to the page that executes whenever the Load event occurs.
- 上一篇:Java与网络英文文献和中文翻译
- 下一篇:中国餐饮业分析英文文献和中文翻译
-
-
-
-
-
-
-
现代简约美式风格在室内家装中的运用
浅析中国古代宗法制度
g-C3N4光催化剂的制备和光催化性能研究
C++最短路径算法研究和程序设计
中国传统元素在游戏角色...
江苏省某高中学生体质现状的调查研究
上市公司股权结构对经营绩效的影响研究
NFC协议物理层的软件实现+文献综述
高警觉工作人群的元情绪...
巴金《激流三部曲》高觉新的悲剧命运