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与网络英文文献和中文翻译
- 下一篇:中国餐饮业分析英文文献和中文翻译
-
-
-
-
-
-
-
十二层带中心支撑钢结构...
河岸冲刷和泥沙淤积的监测国内外研究现状
大众媒体对公共政策制定的影响
电站锅炉暖风器设计任务书
乳业同业并购式全产业链...
酸性水汽提装置总汽提塔设计+CAD图纸
杂拟谷盗体内共生菌沃尔...
当代大学生慈善意识研究+文献综述
java+mysql车辆管理系统的设计+源代码
中考体育项目与体育教学合理结合的研究