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.
Controlling Page Navigation
In the following sections, you learn how to control how a user moves from one ASP.NET page to another. First, you learn how to submit an HTML form to another page and retrieve form information. Next, you learn how to use the Redirect() method to automatically transfer a user to a new page. Finally, you learn how to link pages together with the HyperLink control.
Applying Formatting to Controls
In the following sections, you learn how to make more attractive Web forms. First, you look at an overview of the formatting properties common to all Web controls; they are the formatting properties of the base control class. Next, you learn how to apply Cascading Style Sheet styles and classes to Web controls.
Advanced Control Programming
Working with View State
By default, almost all ASP.NET controls retain the values of their properties between form posts. For example, if you assign text to a Label control and submit the form, when the page is rendered again, the contents of the Label control are preserved.
The magic of view state is that it does not depend on any special server or browser properties.
When used wisely, view state can have a dramatic and positive effect on the performance of your Web site.
Displaying and Hiding Content
Imagine that you are creating a form with an optional section. For example, imagine that you are creating an online tax form, and you want to display or hide a section that contains questions that apply only to married tax filers.
Or, imagine that you want to add an additional help button to the tax form. You might want to hide or display detailed instructions for completing form questions depending on a user's preferences.
Finally, imagine that you want to break the tax form into multiple pages so that a person views only one part of the tax form at a time.
In the following sections, you learn about the properties that you can use to hide and display controls in a form.
Disabling View State
In certain circumstances, you might want to disable view state for an inpidual control or for an ASP.NET page as a whole. For example, you might have a control that contains a lot of data (imagine a RadioButtonList control with 1,000 options). You might not want to load the data into the hidden __VIEWSTATE form field if you are worried that the form data would significantly slow down the rendering of the page.
Using Rich Controls
In the following sections, you learn how to use three of the more feature-rich controls in the ASP.NET framework.
.原文的翻译
ASP.NET 技术构建ASP.NET页面
ASP.NET和.NET Framework
ASP.NET是微软的整体.NET框架,ASP.NET中含有一组数量很大的用于编程的类。
.NET框架类库
微软要支持多种编程语言,如Visual Basic,Jscript和C ++,这些编程语言的功能具有重叠的地方。而且,对于每一种语言,必须有可以文件系统的存储,使用数据库和操作字符串的方法。论文网
除此之外,这些语言有着非常相似的组成。对于每一种语言,可以使用循环和条件的语句。即使我们用Visual Basic编写,语法不同于C ++编写,但实现的功能是一样的。
大多数的编程语言,变量数据类型相似。在大多数语言中,你可以自己设定字符串和整数的类型。整数的最大值最小值可能是语言本身决定的,但它们基本的数据类型却是相同的。
要文护所有这些功能,对多种语言来说,需要大量的工作。为什么要保持重新发明一个模型呢?如果我们对所有的语言都新建同种功能,然后将这个功能使用于每一种语言中不是更容易些吗?
- 上一篇:集成计算机英文文献和中文翻译
- 下一篇:JavaScript的创造力英文文献和中文翻译
-
-
-
-
-
-
-
g-C3N4光催化剂的制备和光催化性能研究
中国传统元素在游戏角色...
浅析中国古代宗法制度
巴金《激流三部曲》高觉新的悲剧命运
上市公司股权结构对经营绩效的影响研究
现代简约美式风格在室内家装中的运用
NFC协议物理层的软件实现+文献综述
C++最短路径算法研究和程序设计
高警觉工作人群的元情绪...
江苏省某高中学生体质现状的调查研究