Library sample chapters
A Preview of Active Server Pages+
- Introduction
- Introducing ASP+
- The Evolution of ASP
- Microsoft ISAPI Technologies
- The Versions of ASP
- Windows 2000, COM+ and ASP 3.0
- The Next Generation Web Services
- What Is the NGWS Framework?
- Common Intermediate Language
- Web Application Infrastructure
- How is ASP+ different?
- Why Do We Need a New Version?
- Advantages with ASP+
- Server-side HTML Controls
- Maintaining State
- Page VIEWSTATE
- Server-side Event Processing
- ASP+ Application Framework
- Enhanced Performance
- Control Families
- Intrinsic Controls
- List Controls
- Rich Controls
- Validation Controls
- The Global Configuration File
- Using Application State
- Using Session State
- New Security Management Features
- Getting Started
- Final Release
- Summary
Intrinsic Controls
In the example we looked at earlier in this chapter, we saw how ASP+ provides a series of Intrinsic Controls that are intelligent. In other words, they can be executed on the server to create output that includes event handling and the maintenance of state (the values the controls display). In Chapters 2, 3, and 4, we look at how we can use these controls in more detail, and explore their various capabilities.
However, to overview the aims of the new ASP+ Intrinsic Controls, we can say that they serve three main purposes:
- They allow the developer to interact with the control on the server when the page is being created, in particular by setting the values of properties or reacting to events that are raised on the client.
- They automatically create the appropriate HTML to preserve their current state, so that they display the correct values as selected by the user when the page is reloaded – without requiring the developer to write code to do this.
- They make development simpler and faster, and promote reusability and better page design and structure by encapsulating the repetitive code required for these tasks within the control.
The basic intrinsic controls are used by simply inserting the equivalent HTML into the page, just as you would in earlier versions of ASP, but adding the runat="server" attribute. The elements that are implemented as specific objects in the preview version of ASP+ are:
|
<table> |
<tr> |
<th> |
<td> |
|
<form> |
<input> |
<select> |
<textarea> |
|
<button> |
<a> |
<img> |
As in HTML, the <input> server control depends on the value of the type attribute. The output that the control creates is, of course, different for each value.
All other HTML elements in an ASP+ page that are marked with the runat="server" attribute are handled by a single generic HTML server control. It creates output based simply on the element itself and any attributes you provide or set server-side when the page is being created.
There is also a set of new ASP+ controls that can be defined within the page, and which are prefixed with the namespace 'asp'. These controls expose properties that correspond to the standard attributes that are available for the equivalent HTML element. As with all server controls, you can set these properties during the server-side Load events of the page, or add them as attributes in the usual way, but using the special property names. When rendered to the client, the properties are converted into the equivalent HTML syntax.
For example, to create an instance of a ListBox control, we can use:
<asp:ListBox rows="3" runat="server">
<asp:ListItem>Windows 98</asp:ListItem>
<asp:ListItem>Windows NT4</asp:ListItem>
<asp:ListItem>Windows 2000</asp:ListItem>
</asp:ListBox>
At runtime (in the preview version) the ASP+ code above creates the following HTML, and sends it to the client:
<SELECT name="ListBox0" size="3">
<OPTION value="Windows 98">Windows 98</OPTION>
<OPTION value="Windows NT4">Windows NT4</OPTION>
<OPTION value="Windows 2000">Windows 2000</OPTION>
</SELECT>
A summary of the 'asp'-prefixed intrinsic controls looks like this:
|
ASP+ Intrinsic Control |
HTML Output Element |
|
<asp:Button> |
<input type="submit"> |
|
<asp:LinkButton> |
<a href="jscript:__doPostBack(...)">...<a> |
|
<asp:ImageButton> |
<input type="image"> |
|
<asp:HyperLink> |
<a href="...">...</a> |
|
<asp:TextBox> |
<input type="text" value="..."> |
|
<asp:CheckBox> |
<input type="checkbox"> |
|
<asp:RadioButton> |
<input type="radio"> |
|
<asp:DropDownList> |
<select>...</select> |
|
<asp:ListBox> |
<select size="...">...</select> |
|
<asp:Image> |
<img src="..."> |
|
<asp:Label> |
<span>...</span> |
|
<asp:Panel> |
<div>...</div> |
|
<asp:Table> |
<table>...</table> |
|
<asp:TableRow> |
<tr>...</tr> |
|
<asp:TableCell> |
<td>...</td> |
These controls provide more standardized property sets than the HTML controls, and make it easier to implement tools that can be used for designing and building ASP+ pages and applications.
Related articles
Related discussion
-
How can I execute server-side function using asp.net Ontextchanged orJavascript onchange?
by mamoru0916 (0 replies)
-
we search the company in India for program creation under the order
by anand.lv (1 replies)
-
handling special character in xslt's
by bussureddy82 (1 replies)
-
String was not recognized as a valid DateTime.
by buvanasubi (22 replies)
-
RadioButton inside Repeater with Javascript
by Aquila (1 replies)
Events coming up
-
Dec
3
An afternoon of SQL Server Data Services and ASP.NET Dynamic Data
Bradford, United Kingdom
This event is in association with Black Marble. In the morning Black Marble will be presenting on Microsoft "Oslo": The Future of Enterprise Applications. To find out more about this please follow the link on the right.
I'm not interested to think 4 these silly things. Keep going....
Reading all these articles on the web site is just a simple waisting of time!
This thread is for discussions of A Preview of Active Server Pages+.