- .NET's Control Model
- Separating Presentation from Code Using Code Behind
- Programming HTML Controls
- Attributes of the Page Object
- Creating User Interfaces with Web Controls
- Server Controls and Page Object Reference
Server Controls and Page Object Reference
This section provides a quick reference to the key objects described in this chapter. Space constraints prevent us from documenting every object in the .NET framework in this book. For the sake of brevity and conciseness, we include only the most important objects here. For more information on the other objects in the .NET framework, consult the .NET Framework Reference online help file.
Validation controls are covered in Chapter 12.
This chapter covers the Page framework classes in ASP.NET, including the Page object itself, its children, and user-interface controls (HTML controls and server controls). The following sections provide a brief reference to the properties, methods, and events provided by those classes.
AdRotator Class
Member of System.Web.UI.WebControls.
The AdRotator class enables you to display a graphical advertisement on your Web page, changing (or "rotating") the advertisement from a list of graphical URLs. Because they are stored in the form of URLs, the graphics and the pages they link to can reside anywhere on the Web.
Properties |
|
|
AccessKey |
CssClass |
Site |
AdvertisementFile |
Enabled |
Style |
BackColor |
EnableViewState |
TabIndex |
BorderColor |
Font |
Target |
BorderStyle |
ForeColor |
TemplateSourceDirectory |
BackWidth |
Height |
ToolTip |
BackColor |
ID |
UniqueID |
ClientID |
KeywordFilter |
Visible |
Controls |
NamingContainer |
Width |
ControlStyle |
Page |
|
ControlStyleCreated |
Parent |
|
Methods |
|
|
AddAttributesToRender |
GetHashCode |
OnUnload |
AddParsedSubObject |
GetType |
RaiseBubbleEvent |
ApplyStyle |
HasControls |
Render |
ClearChildViewState |
IsLiteralContent |
RenderBeginTag |
CopyBaseAttributes |
LoadViewState |
RenderChildren |
CreateChildControls |
MapPathSecure |
RenderContents |
CreateControlCollection |
MemberWiseClone |
RenderControl |
CreateControlStyle |
MergeStyle |
RenderEndTag |
DataBind |
OnAdCreated |
ResolveURL |
Dispose |
OnBubbleEvent |
SaveViewState |
EnsureChildControls |
OnDataBinding |
ToString |
Equals |
OnInit |
TrackViewState |
Finalize |
OnLoad |
|
FindControl |
OnPreRender |
|
Events |
|
|
AdCreated |
Init |
UnLoad |
DataBinding |
Load |
|
Disposed |
PreRender |
|
The list of advertisements is stored in an XML file. Listing 3.29 shows an example of an XML file.
Listing 3.29 Using the AdRotator Class
<?xml version="1.0" encoding="utf-8" ?> <Advertisements> <Ad> <ImageUrl>ad-1.png</ImageUrl> <NavigateUrl>http://www.redblazer.com/</NavigateUrl> <AlternateText>Advertisement Number One</AlternateText> </Ad> <Ad> <ImageUrl>ad-2.png</ImageUrl> <NavigateUrl>http://www.redblazer.com/</NavigateUrl> <AlternateText>Advertisement Number Two</AlternateText> </Ad> </Advertisements>
The ImageUrl node denotes which image to display. The NavigateUrl note indicates the page to which the advertisement is linked. The value of the AlternateText node is displayed if the browser has graphics turned off in the browser.
You can have as many Ad elements as you want; the AdRotator will randomly switch between them. To see this, reload the page several times. (To avoid viewing a cached version of the page, be sure you press Ctrl+F5 rather than using the View, Refresh menu command in your browser.)
Note
The standard dimensions for a Web advertising banner is 468 pixels wide by 60 pixels high. You can, of course, use the AdRotator control to display images of any dimensions you want.
You link an XML file with an instance of an AdRotator control by assigning the name of the file to the AdRotator control's AdvertisementFile property. Listing 3.30 shows an example.
Listing 3.30 Using an AdRotator Control to Display Various Advertising Banners in an ASP.NET Page
<%@ Page Language="vb" debug="False" %> <HTML> <HEAD> <title>ASP.NET AdRotator Control</title> </HEAD> <body> <form id="Form1" runat="server"> <asp:AdRotator id="AdRotator1" runat="server" Width="468px" Height="60px" AdvertisementFile="ads.xml" /> </form> </body> </HTML>
As you can see, no event procedure code is necessary to use the AdRotator control (although the control does provide an AdCreated event you can use to intercept and reassign the properties of the advertisement before it is rendered on the page).
Button Class
Member of System.Web.UI.WebControls.
The Button class is the ASP.NET Web control equivalent of the HTML submit and button elements. The class abstracts both elements, adding a number of additional properties and events as well.
Properties |
|
|
||
AccessKey |
ControlStyle |
Page |
||
Attributes |
ControlStyleCreated |
Parent |
||
BackColor |
EnableViewState |
Site |
||
BorderColor |
CssClass |
Style |
||
BorderStyle |
Enabled |
TabIndex |
||
BorderWidth |
EnableViewState |
TemplateSourceDirectory |
||
CausesValidation |
Font |
Text |
||
ClientID |
ForeColor |
ToolTip |
||
CommandArgument |
Height |
UniqueID |
||
CommandName |
ID |
Visible |
||
Controls |
NamingContainer |
Width |
||
Methods |
|
|
||
AddAttributesToRender |
GetHashCode |
OnPreRender |
||
AddParsedSubObject |
GetType |
OnUnload |
||
ApplyStyle |
HasControls |
RaiseBubbleEvent |
||
ClearChildViewState |
IsLiteralContent |
Render |
||
CopyBaseAttributes |
LoadViewState |
RenderBeginTag |
||
CreateChildControls |
MapPathSecure |
RenderContents |
||
CreateControlCollection |
MemberwiseClone |
RenderControl |
||
CreateControlStyle |
MergeStyle |
RenderEndTag |
||
DataBind |
OnBubbleEvent |
ResolveUrl |
||
Dispose |
OnClick |
SaveViewState |
||
EnsureChildControls |
OnCommand |
ToString |
||
Equals |
OnDataBinding |
TrackViewState |
||
Finalize |
OnInit |
|
||
FindControl |
OnLoad |
|
||
Events |
|
|
||
Click |
Disposed |
PreRender |
||
Command |
Init |
UnLoad |
||
DataBinding |
Load |
|
Code examples that use the Button object are given throughout this book. Essentially, only two members of the Button object are used with any regularity: the Text property, to display text on the button face, and the Click event, which generates a form submit.
Calendar Class
Member of System.Web.UI.WebControls.
The Calendar class renders a calendar in HTML. In most cases, you'll want to respond to a user selecting a date in the calendar; do this by handling the control's SelectionChanged event.
Properties |
|
|
AccessKey |
Font |
ShowGridLines |
Attributes |
ForeColor |
ShowNextPrevMonth |
BackColor |
HasChildViewState |
ShowTitle |
BorderColor |
Height |
Site |
BorderStyle |
ID |
Style |
BorderWidth |
IsTrackingViewState |
TabIndex |
CellPadding |
NamingContainer |
TagKey |
CellSpacing |
NextMonthText |
TagName |
ChildControlsCreated |
NextPrevFormat |
TemplateSourceDirectory |
ClientID |
NextPrevStyle |
TitleFormat |
Context |
OtherMonthDayStyle |
TitleStyle |
Controls |
Page |
TodayDayStyle |
ControlStyle |
Parent |
TodaysDate |
ControlStyleCreated |
PrevMonthText |
ToolTip |
CssClass |
SelectedDate |
UniqueID |
DayHeaderStyle |
SelectedDates |
ViewState |
DayNameFormat |
SelectedDayStyle |
ViewStateIgnoresCase |
DayStyle |
SelectionMode |
Visible |
Enabled |
SelectMonthText |
VisibleDate |
EnableViewState |
SelectorStyle |
WeekendDayStyle |
Events |
SelectWeekText |
Width |
FirstDayOfWeek |
ShowDayHeader |
|
Methods |
|
|
AddAttributesToRender |
FindControl |
OnSelectionChanged |
AddParsedSubObject |
GetHashCode |
OnUnload |
ApplyStyle |
GetType |
OnVisibleMonthChanged |
BuildProfileTree |
HasControls |
RaiseBubbleEvent |
ClearChildViewState |
IsLiteralContent |
Render |
CopyBaseAttributes |
LoadViewState |
RenderBeginTag |
CreateChildControls |
MapPathSecure |
RenderChildren |
CreateControlCollection |
MemberwiseClone |
RenderContents |
CreateControlStyle |
MergeStyle |
RenderControl |
DataBind |
OnBubbleEvent |
RenderEndTag |
Dispose |
OnDataBinding |
ResolveUrl |
EnsureChildControls |
OnDayRender |
SaveViewState |
Equals |
OnInit |
SetRenderMethodDelegate |
Finalize |
OnLoad |
ToString |
FindControl |
OnPreRender |
TrackViewState |
Events |
|
|
DataBinding |
Init |
SelectionChanged |
DayRender |
Load |
Unload |
Disposed |
PreRender |
VisibleMonthChanged |
Listing 3.31 shows an example of a page that displays a Calendar control and a label. When the user selects a date in the calendar, the label indicates which date the user selected.
Listing 3.31 Responding to a User Selection in the Calendar Server Control
<%@ Page Language="vb" debug="false"%> <SCRIPT runat='server'> Sub Calendar1_SelectionChanged(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Label1.Text = "The date you selected is " & Calendar1.SelectedDate End Sub </SCRIPT> <HTML> <HEAD> <TITLE>ASP.NET Calendar Control</TITLE> </HEAD> <body> <form id="Form1" method="post" runat="server"> <asp:Calendar id="Calendar1" OnSelectionChanged="Calendar1_SelectionChanged" runat="server"> </asp:Calendar> <BR> <asp:Label id="Label1" runat="server"></asp:Label> </form> </body> </HTML>
CheckBox Class
Member of System.Web.UI.WebControls.
The CheckBox class is the Web control abstraction of the HTML CHECKBOX element, used to enable the user to select a true/false or yes/no condition.
Properties |
|
|
AccessKey |
CssClass |
Style |
Attributes |
Enabled |
TabIndex |
AutoPostBack |
EnableViewState |
TagKey |
BackColor |
Events |
TagName |
BorderColor |
Font |
TemplateSourceDirectory |
BorderStyle |
ForeColor |
Text |
BorderWidth |
HasChildViewState |
TextAlign |
Checked |
Height |
ToolTip |
ChildControlsCreated |
ID |
UniqueID |
ClientID |
IsTrackingViewState |
ViewState |
Context |
NamingContainer |
ViewStateIgnoresCase |
Controls |
Page |
Visible |
ControlStyle |
Parent |
Width |
ControlStyleCreated |
Site |
|
Methods |
|
|
AddAttributesToRender |
GetHashCode |
OnUnload |
AddParsedSubObject |
GetType |
RaiseBubbleEvent |
ClearChildViewState |
HasControls |
Render |
CopyBaseAttributes |
IsLiteralContent |
RenderBeginTag |
CreateChildControls |
LoadViewState |
RenderChildren |
CreateChildCollection |
MapPathSecure |
RenderContents |
CreateControlStyle |
MemberwiseClone |
RenderControl |
DataBind |
MergeStyle |
RenderEndTag |
Dispose |
OnBubbleEvent |
ResolveUrl |
Equals |
OnCheckedChanged |
SaveViewState |
EnsureChildControls |
OnDataBinding |
ToString |
Finalize |
OnInit |
TrackViewState |
FindControl |
OnLoad |
|
GetHashCode |
OnPreRender |
|
Events |
|
|
CheckedChanged |
Init |
UnLoad |
DataBinding |
Load |
|
Disposed |
PreRender |
|
You can determine whether the check box is checked by inspecting its Boolean Checked property. Setting its Text property assigns a text label to the check box; the TextAlign property determines where the accompanying text label is displayed. Listing 3.32 shows an example.
Listing 3.32 Reading the Checked Value of an ASP.NET CheckBox Server Control
<%@ Page Language="vb" debug="False" %> <HTML> <HEAD> <title>ASP.NET CheckBox Control</title> <SCRIPT runat='server'> Sub CheckChanged(Sender As Object, e As EventArgs) If CheckBox1.Checked Then CheckBox1.Text = "Thank you for checking this." Else CheckBox1.Text = "Check This!" End If End Sub </SCRIPT> </HEAD> <body> <form runat="server"> <asp:CheckBox id="CheckBox1" runat="server" Text="Check This!" TextAlign="Left" /><BR> <asp:button OnClick="CheckChanged" text="Send" runat="server" /> </form> </body> </HTML>
Control Class
Member of System.Web.UI.
The Control class serves as the base class for all ASP.NET server controls.
Properties |
|
|
ChildControlsCreated |
HasChildViewState |
Site |
ClientID |
ID |
TemplateSourceDirectory |
Context |
IsTrackingViewState |
UniqueID |
Controls |
NamingContainer |
ViewState |
EnableViewState |
Page |
ViewStateIgnoresCase |
Events |
Parent |
Visible |
Methods |
|
|
AddParsedSubObject |
GetHashCode |
OnUnload |
BuildProfileTree |
GetType |
OnUnload |
ClearChildViewState |
HasControls |
RaiseBubbleEvent |
CreateChildControls |
IsLiteralContent |
Render |
CreateControlCollection |
LoadViewState |
RenderChildren |
DataBind |
MemberwiseClone |
RenderControl |
Dispose |
OnBubbleEvent |
ResolveUrl |
EnsureChildControls |
OnDataBinding |
SaveViewState |
Equals |
OnInit |
SetRenderMethodDelegate |
Finalize |
OnLoad |
ToString |
FindControl |
OnPreRender |
TrackViewState |
FindControl |
OnPreRender |
|
Events |
|
|
DataBinding |
Init |
PreRender |
Disposed |
Load |
Unload |
DataGrid Class
Member of System.Web.UI.WebControls.
The DataGrid class enables you to display data in a tabular (row and column) format. Like all data-bound ASP.NET controls, the DataGrid need not be bound to a traditional relational data source; you can also bind to an array or one of the many collection objects provided in the .NET framework.
The HTML output of this control is a table, but the DataGrid class adds a number of useful additional accoutrements such as data paging and formatting.
Properties |
|
|
AccessKey |
CurrentPageIndex |
PageCount |
AllowCustomPaging |
DataKeys |
PagerStyle |
AllowPaging |
DataMember |
PageSize |
AllowSorting |
DataSource |
Parent |
AlernativeItemStyle |
EditItemIndex |
SelectedIndex |
Attributes |
EditItemStyle |
SelectedItem |
AutoGenerateColumns |
Enabled |
SelectedItemStyle |
BackColor |
EnableViewState |
ShowFooter |
BackImageUrl |
Events |
ShowHeader |
BorderColor |
Font |
Site |
BorderStyle |
FooterStyle |
Style |
BorderWidth |
ForeColor |
TabIndex |
CellPadding |
GridLines |
TagKey |
CellSpacing |
HasChildViewState |
TagName |
ChildControlsCreated |
HeaderStyle |
TemplateSourceDirectory |
ClientID |
HorizontalAlign |
ToolTip |
Columns |
ID |
UniqueID |
Context |
IsTrackingViewState |
ViewState |
Controls |
Items |
ViewStateIgnoresCase |
ControlStyle |
ItemStyle |
VirtualItemCount |
ControlStyleCreated |
NamingContainer |
Visible |
CssClass |
Page |
Width |
Methods |
|
|
AddAttributesToRender |
HasControls |
OnPageIndexChanged |
AddParsedSubObject |
IsLiteralContent |
OnPreRender |
ApplyStyle |
LoadViewState |
OnSelectedIndexChanged |
ClearChildViewState |
MapPathSecure |
OnSortCommand |
CopyBaseAttributes |
MemberwiseClone |
OnUnload |
CreateChildControls |
MergeStyle |
OnUpdateCommand |
CreateControlCollection |
OnBubbleEvent |
Render |
CreateControlStyle |
OnCancelCommand |
RenderBeginTag |
DataBind |
OnDataBinding |
RenderChildren |
Dispose |
OnDeleteCommand |
RenderContents |
Equals |
OnEditCommand |
RenderControl |
EnsureChildControls |
OnInit |
RenderEndTag |
Finalize |
OnItemCommand |
ResolveUrl |
FindControl |
OnItemCreated |
SaveViewState |
GetHashCode |
OnItemDataBound |
ToString |
GetType |
OnLoad |
TrackViewState |
Events |
|
|
CancelCommand |
ItemCommand |
SelectedIndexChanged |
DataBinding |
ItemCreated |
SortCommand |
DeleteCommand |
ItemDataBound |
Unload |
Disposed |
Load |
UpdateCommand |
EditCommand |
PageIndexChanged |
|
Init |
PreRender |
|
You can find a number of code examples that utilize the DataGrid control in Chapter 12.
DataList Class
Member of System.Web.UI.WebControls.
The DataList class enables you to display data in a list. The control is similar to the DataGrid control, but instead of displaying multiple categories of data in a tabular (row-and-column) format, the DataList displays a single list of data in a single row. This row can wrap into multiple columns, however.
The various elements of the DataList (header, footer, and items) are divided up into sections and formatted according to templates. Templates are XML sections embedded in the script declaration of the control.
Properties |
|
|
AccessKey |
EditItemTemplate |
RepeatColumns |
AlternatingItemStyle |
Enabled |
RepeatDirection |
AlternatingItemTemplate |
EnableViewState |
RepeatLayout |
Attributes |
ExtractTemplateRows |
SelectedIndex |
BackColor |
Events |
SelectItemStyle |
BorderColor |
Font |
SelectItemTemplate |
BorderStyle |
FooterStyle |
SeparatorStyle |
BorderWidth |
FooterTemplate |
SeparatorTemplate |
CellPadding |
ForeColor |
ShowFooter |
CellSpacing |
GridLines |
ShowHeader |
ChildControlsCreated |
HasChildViewState |
Site |
ClientID |
HeaderStyle |
Style |
Context |
HeaderTemplate |
TabIndex |
Controls |
Height |
TagKey |
ControlStyle |
HorizontalAlign |
TagName |
ControlStyleCreated |
ID |
TemplateSourceDirectory |
CssClass |
IsTrackingViewState |
ToolTip |
DataKeyField |
Items |
UniqueID |
DataKeys |
ItemStyle |
ViewState |
DataMember |
ItemTemplate |
ViewStateIgnoresCase |
DataSource |
NamingContainer |
Visible |
EditItemIndex |
Page |
Width |
EditItemStyle |
Parent |
|
Methods |
|
|
AddAttributesToRender |
HasControls |
OnPreRender |
AddParsedSubObject |
IsLiteralContent |
OnSelectedIndexChanged |
ApplyStyle |
LoadViewState |
OnUnload |
ClearChildViewState |
MapPathSecure |
OnUpdateCommand |
CopyBaseAttributes |
MemberwiseClone |
RaiseBubbleEvent |
CreateChildControls |
MergeStyle |
Render |
CreateControlCollection |
OnBubbleEvent |
RenderBeginTag |
CreateControlStyle |
OnCancelCommand |
RenderChildren |
DataBind |
OnDataBinding |
RenderContents |
Dispose |
OnDeleteCommand |
RenderControl |
Equals |
OnEditCommand |
RenderEndTag |
EnsureChildControls |
OnInit |
ResolveUrl |
Finalize |
OnItemCommand |
SaveViewState |
FindControl |
OnItemCreated |
ToString |
GetHashCode |
OnItemDataBound |
TrackViewState |
GetType |
OnLoad |
|
Events |
|
|
CancelCommand |
Init |
PreRender |
DataBinding |
ItemCommand |
SelectedIndexChanged |
DeleteCommand |
ItemCreated |
Unload |
Disposed |
ItemDataBound |
UpdateCommand |
EditCommand |
Load |
|
Listing 3.33 provides an example of a DataList control bound to a Hashtable object.
Listing 3.33 Displaying Data in a Hashtable Object in a DataList Server Control
<% @Page language="VB" debug="true" %> <html> <HEAD> <TITLE>ASP.NET DataList Control</TITLE> <SCRIPT runat="server"> Sub Page_Load(sender As Object, e As EventArgs) If Not IsPostBack Then Dim h As Hashtable = new Hashtable() h.Add ("SF", "San Francisco") h.Add ("AZ", "Arizona") h.Add ("CO", "Colorado") h.Add ("SD", "San Diego") h.Add ("LA", "Los Angeles") DataList1.DataSource = h DataList1.DataBind End If End Sub </script> <body> <form runat=server> <asp:DataList id="DataList1" runat="server" BorderColor="black" BorderWidth="1" CellPadding="3" Font-Name="Verdana" Font-Size="8pt"> <HeaderStyle BackColor="#000000" ForeColor="#FFFF99"> </HeaderStyle> <AlternatingItemStyle BackColor="#FFFF99"> </AlternatingItemStyle> <HeaderTemplate> National League West </HeaderTemplate> <ItemTemplate> <%# DataBinder.Eval(Container.DataItem, "Value") %> [<%# DataBinder.Eval(Container.DataItem, "Key") %>] </ItemTemplate> </asp:DataList> </form> </body> </html>
Note that, as with all data-bindable objects, you can bind the DataList to a wide variety of objects. We used the Hashtable object in this example for simplicity, but you could bind to an ArrayList, a DataSet, or any other list type.
DropDownList Class
Member of System.Web.UI.WebControls.
The DropDownList class is the server control abstraction of the HTML SELECT. Like most list controls, it can be bound to data.
Properties |
|
|
AccessKey |
DataMember |
SelectedIndex |
Attributes |
DataSource |
SelectedItem |
AutoPostBack |
DataTextField |
Site |
BackColor |
DataTextFormatString |
Style |
BorderColor |
DataValueField |
TabIndex |
BorderStyle |
Enabled |
TagKey |
BorderWidth |
EnabledViewState |
TagName |
ChildControlsCreated |
Font |
TemplateSourceDirectory |
ClientID |
ForeColor |
ToolTip |
Context |
IsTrackingViewState |
UniqueID |
Controls |
Items |
ViewState |
ControlStyle |
NamingContainer |
ViewStateIgnoresCase |
ControlStyleCreated |
Page |
Visible |
CssClass |
Parent |
Width |
Methods |
|
|
AddAttributesToRender |
GetType |
Render |
AddParsedSubObject |
HasControls |
RenderBeginTag |
ApplyStyle |
IsLiteralContent |
RenderChildren |
ClearChildViewState |
LoadViewState |
RenderContents |
CopyBaseAttributes |
MapPathSecure |
RenderControl |
CreateChildControls |
MemberwiseClone |
RenderEndTag |
CreateControlCollection |
MergeStyle |
ResolveUrl |
CreateControlStyle |
OnBubbleEvent |
SaveViewState |
DataBind |
OnDataBinding |
ToString |
Dispose |
OnInit |
TrackViewState |
Equals |
OnLoad |
|
EnsureChildControls |
OnPreRender |
|
Finalize |
OnSelectedIndexChanged |
|
FindControl |
OnUnload |
|
GetHashCode |
RaiseBubbleEvent |
|
Events |
|
|
CancelCommand |
Init |
PreRender |
DataBinding |
ItemCommand |
SelectedIndexChanged |
DeleteCommand |
ItemCreated |
Unload |
Disposed |
ItemDataBound |
UpdateCommand |
EditCommand |
Load |
|
Listing 3.34 shows an example of a DropDownList object that is bound to an ArrayList object.
Listing 3.34 Binding a DropDownList Control to Data Contained in an ArrayList Object
<% @Page language="VB" debug="true" %> <html> <HEAD> <TITLE>ASP.NET DropDownList Control</TITLE> <SCRIPT runat="server"> Sub Page_Load(Sender As Object, e As EventArgs) If Not IsPostBack Then Dim list As ArrayList = new ArrayList() list.Add ("San Francisco") list.Add ("Arizona") list.Add ("Colorado") list.Add ("San Diego") list.Add ("Los Angeles") DropDownList1.DataSource = list DropDownList1.DataBind End If End Sub Sub Pick_Click(Sender As Object, e As EventArgs) Label1.Text = "You selected " & DropDownList1.SelectedItem.Text End Sub </script> <body> <form runat=server> <asp:DropDownList id="DropDownList1" runat="server" BorderColor="black" BorderWidth="1" CellPadding="3" Font-Name="Verdana" Font-Size="8pt"> </asp:DropDownList> <asp:button text="Pick" OnClick="Pick_Click" runat="server" /><BR> <asp:label id="Label1" runat="server" /> </form> </body> </html>
Use the SelectedItem object contained by the DropDownList control to return information about the item selected by the user. The SelectedItem object (an instance of System.Web.UI.WebControls.ListItem) contains a Text property as well as a Value property, enabling you to retrieve both the displayed value and the key associated with the selected value.
In addition to binding the DropDownList object to a list object such as ArrayList, you can also hard-code the list definitions by using <asp:listitem> subelements in the DropDownList definition.
HttpApplication Class
Member of System.Web.
This object is typically accessed as the Application object contained in the ASP.NET Page object.
The HttpApplication class provides a way to store information that has application scope. The Application object contains instances objects such as Request and Response objects (instances of the HttpRequest and HttpResponse classes, respectively) that you can use to access the contents of conventional HTML forms.
Properties |
|
|
||
Application |
Request |
Site |
||
Context |
Response |
User |
||
Events |
Server |
|
||
Modules |
Session |
|
||
Methods |
|
|
||
AddOnAcquireRequestStateAsync |
CompleteRequest |
|
||
AddOnReleaseRequestStateAsync |
Dispose |
|
||
AddOnAuthenticateRequestAsync |
Equals |
|
||
AddOnResolveRequestCacheAsync |
Finalize |
|
||
AddOnAuthenticateRequestAsync |
GetHashCode |
|
||
AddOnUpdateRequestCacheAsync |
GetType |
|
||
AddOnBeginRequestAsync |
GetVaryByCustomString |
|
||
AddOnEndRequestAsync |
Init |
|
||
AddOnPostRequestHandlerExecuteAsync |
MemberwiseClone |
|
||
AddOnPreRequestHandlerExecuteAsync |
ToString |
|
HttpRequest Class
Member of System.Web.UI.
The HttpRequest class represents a request made by a client. It is typically accessed by programmers through the Request object contained in the ASP.NET Page object.
You can use the Request object to set or retrieve the value of cookies, read HTTP header information generated by a Web request, get information about the browser that made the request, and poll the client for security related information.
Properties |
|
|
||
AcceptTypes |
Files |
PhysicalApplicationPath |
||
ApplicationPath |
Filter |
PhysicalPath |
||
Browser |
Form |
QueryString |
||
ClientCertificate |
Headers |
RawURL |
||
ContentEncoding |
HttpMethod |
UrlReferrer |
||
ContentLength |
InputStream |
UserAgent |
||
ContentType |
IsAuthenticated |
UserHostAddress |
||
Cookies |
IsSecureConnection |
UserHostName |
||
CurrentExecutionFilePath |
Params |
UserLanguages |
||
FilePath |
PathInfo |
|
||
Methods |
|
|
||
BinaryRead |
GetType |
SaveAs |
||
Equals |
MapImageCoordinates |
ToString |
||
Finalize |
MapPath |
|
||
GetHashCode |
MemberwiseClone |
|
HttpResponse Class
Member of System.Web.UI.
The HttpResponse class represents the data sent to a client in reply to a request. This can include the response itself (handled by the Write method) as well as headers and other configuration data (such as page cache expiry and HTTP headers).
Properties |
|
|
Buffer |
ContentType |
Output |
BufferOutput |
Cookies |
OutputStream |
Cache |
Expires |
Status |
CacheControl |
ExpiresAbsolute |
StatusCode |
Charset |
Filter |
StatusDescription |
ContentEncoding |
IsClientConnected |
SuppressContent |
Methods |
|
|
AddCacheItemDependencies |
Clear |
GetType |
AddCacheItemDependency |
ClearContent |
MemberwiseClone |
AddFileDependencies |
ClearHeaders |
Pics |
AddFileDependency |
Close |
Redirect |
AddHeader |
End |
RemoveOutputCacheItem |
AppendHeader |
Equals |
ToString |
AppendToLog |
Finalize |
Write |
ApplyAppPathModifier |
Flush |
WriteFile |
BinaryWrite |
GetHashCode |
|
HttpServerUtility Class
Member of System.Web.UI.
The HttpServerUtility class provides a variety of utilities for ASP.NET programmers, such as mapping a file request to the file system of the Web server (the MapPath method) and encoding data for use in a URL (the UrlEncode method). It is typically accessed by ASP.NET developers as the Server object contained by the ASP.NET Page object.
Properties |
|
|
MachineName |
ScriptTimeout |
|
Methods |
|
|
ClearError |
GetHashCode |
MemberwiseClone |
CreateObject |
GetLastError |
ToString |
CreateObjectFromClsid |
GetType |
Transfer |
Equals |
HtmlDecode |
UrlDecode |
Execute |
HtmlEncode |
UrlEncode |
Finalize |
MapPath |
UrlPathEncode |
HttpSessionState Class
Member of System.Web.UI.
The HttpSessionState class is used to store and retrieve session state in an ASP.NET application. It is typically accessed by ASP.NET developers in the form of the Session object, contained by the ASP.NET Page object.
Properties |
|
|
CodePage |
IsReadOnly |
Mode |
Contents |
isSyncronized |
SessionID |
Counts |
Item |
StaticObjects |
IsCookieless |
Keys |
SyncRoot |
IsNewSession |
LCID |
Timeout |
Methods |
|
|
Abandon |
Finalize |
Remove |
Add |
GetEnumerator |
RemoveAll |
Clear |
GetHashCode |
RemoveAt |
CopyTo |
GetType |
ToString |
Equals |
MemberwiseClone |
|
Hyperlink Class
Member of System.Web.UI.WebControls.
The Hyperlink class is the ASP.NET server control abstraction of the HTML A element.
Properties |
|
|
AccessKey |
EnabledViewState |
Style |
Attributes |
Events |
TabIndex |
BackColor |
Font |
TagKey |
BorderColor |
ForeColor |
TagName |
BorderStyle |
HasChildViewState |
Target |
BorderWidth |
Height |
TemplateSourceDirectory |
ChildControlsCreated |
ID |
Text |
ClientID |
ImageUrl |
ToolTip |
Context |
IsTrackingViewState |
UniqueID |
Controls |
NamingContainer |
ViewState |
ControlStyle |
NavigateUrl |
ViewStateIgnoresCase |
ControlStyleCreated |
Page |
Visible |
CssClass |
Parent |
Width |
Enabled |
Site |
|
Methods |
|
|
AddAttributesToRender |
GetHashCode |
OnPreRender |
AddParsedSubObject |
GetType |
OnUnload |
ApplyStyle |
HasControls |
RaiseBubbleEvent |
ClearChildViewState |
IsLiteralContent |
Render |
CopyBaseAttributes |
LoadViewState |
RenderBeginTag |
CreateChildControls |
MapPathSecure |
RenderChildren |
CreateControlCollection |
MemberwiseClone |
RenderContents |
CreateControlStyle |
MergeStyle |
RenderControl |
DataBind |
OnBubbleEvent |
RenderEndTag |
Dispose |
OnDataBinding |
ResolveUrl |
EnsureChildControls |
OnInit |
SaveViewState |
Equal |
OnLoad |
ToString |
Finalize |
OnPreRender |
TrackViewState |
FindControl |
OnUnload |
|
Use the Text property of the Hyperlink control to specify the text the control should display. Use the NavigateUrl property to determine which page to navigate to. As with the HTML target attribute, you can specify the target window to navigate to by assigning a value to the control's Target property; special values such as "_self" and "_new" are recognized by the control.
Image Class
Member of System.Web.UI.WebControls.
The Image class is the ASP.NET server control abstraction of the HTML IMG element.
Properties |
|
|
Flags |
PhysicalDimension |
Size |
FrameDimensionsList |
PixelFormat |
VerticalResolution |
Height |
PropertyIdList |
Width |
HorizontalResolution |
PropertyItems |
|
|
|
|
|
|
|
Dispose |
GetLifetimeServices |
RemovePropertyItem |
Equals |
GetPixelFormatSize |
RotateFlip |
Finalize |
GetPropertyItem |
Save |
FromFile |
GetThumbnailImage |
SaveAdd |
FromHbitmap |
GetType |
SelectActiveFrame |
FromStream |
InitializeLifetimeService |
SetPropertyItem |
GetBounds |
IsAlphaPixelFormat |
ToString |
|
|
|
Use the ImageUrl property to specify which image to display. To create an image that works like a button, use the ImageButton control instead.
ImageButton Class
Member of System.Web.UI.WebControls.
The ImageButton class is another ASP.NET server control abstraction of the HTML IMG element, with the addition of a behavior that makes the control act like a button.
Properties |
|
|
AccessKey |
ControlStyleCreated |
Parent |
AlternateText |
CssClass |
Site |
Attributes |
Enabled |
Style |
BackColor |
EnableViewState |
TabIndex |
BorderColor |
Events |
TagKey |
BorderStyle |
Font |
TagName |
BorderWidth |
ForeColor |
TemplateSourceDirectory |
CausesValidation |
HasChildViewState |
ToolTip |
ChildControlsCreated |
Height |
UniqueID |
ClientID |
ID |
ViewState |
CommandArgument |
ImageAlign |
ViewStateIgnoresCase |
CommandName |
ImageUrl |
Visible |
Context |
IsTrackingViewState |
Width |
Controls |
NamingContainer |
|
ControlStyle |
Page |
|
Methods |
|
|
AddAttributesToRender |
GetHashCode |
OnPreRender |
AddParsedSubObject |
GetType |
OnUnload |
ApplyStyle |
HasControls |
RaiseBubbleEvent |
CopyBaseAttributes |
IsLiteralConent |
Render |
ClearChildViewState |
LoadViewState |
RenderBeginTag |
CreateChildControls |
MapPathSecure |
RenderChildren |
CreateControlCollection |
MemberwiseClone |
RenderContents |
CreateControlStyle |
MergeStyle |
RenderEndTag |
DataBind |
OnBubbleEvent |
ResolveUrl |
Dispose |
OnClick |
SaveViewState |
Equals |
OnCommand |
ToString |
EnsureChildControls |
OnDataBinding |
TrackViewState |
Finalize |
OnInit |
|
FindControl |
OnLoad |
|
Events |
|
|
Click |
Disposed |
PreRender |
Command |
Init |
Unload |
DataBinding |
Load |
|
Assign a value to the ImageUrl property to specify which graphic to display (just as you would with the Image control). To execute code in response to a user clicking the image, use the control's Click event, the same as you would for a Button control.
Label Class
Member of System.Web.UI.WebControls.
The Label class provides a way to programmatically create a read-only text region on the page. This region is typically rendered in HTML as a SPAN tag.
Properties |
|
|
AccessKey |
Enabled |
Style |
Attributes |
EnableViewState |
TabIndex |
BackColor |
Events |
TagKey |
BorderColor |
Font |
TagName |
BorderStyle |
ForeColor |
Text |
BorderWidth |
HasChildViewState |
TemplateSourceDirectory |
ChildControlsCreated |
Height |
ToolTip |
ClientID |
ID |
UniqueID |
Context |
IsTrackingViewState |
ViewState |
Controls |
NamingContainer |
ViewStateIgnoresCase |
ControlStyle |
Page |
Visible |
ControlStyleCreated |
Parent |
Width |
CssClass |
Site |
|
Methods |
|
|
AddAttributesToRender |
FindControl |
OnUnload |
AddParsedSubObject |
Finalize |
RaiseBubbleEvent |
ApplyStyle |
GetHashCode |
Render |
ClearChildViewState |
GetType |
RenderBeginTag |
CopyBaseAttributes |
HasControls |
RenderChildren |
ClearChildViewState |
IsLiteralContent |
RenderContents |
CreateChildControls |
MapPathSecure |
RenderControl |
CreateControlCollection |
MemberwiseClone |
RenderEndTag |
CreateControlStyle |
MergeStyle |
ResolveUrl |
DataBind |
OnDataBinding |
SaveViewState |
Dispose |
OnInit |
ToString |
Equals |
OnLoad |
TrackViewState |
EnsureChildControls |
OnPreRender |
|
A number of code examples involving the Label class are provided throughout this book. In nearly every case, the only member you'll typically need to access is the control's Text property.
LinkButton Class
Member of System.Web.UI.WebControls.
The LinkButton class merges the functionality of a hyperlink with the functionality of the Button control.
Properties |
|
|
AccessKey |
ControlStyleCreated |
Site |
Attributes |
CssClass |
Style |
BackColor |
Enabled |
TabIndex |
BorderColor |
EnableViewState |
TagKey |
BorderStyle |
Events |
TagName |
BorderWidth |
Font |
TemplateSourceDirectory |
CausesValidation |
ForeColor |
Text |
ChildControlsCreated |
HasChildViewState |
ToolTip |
ClientID |
Height |
UniqueID |
CommandArgument |
ID |
ViewState |
CommandName |
IsTrackingViewState |
ViewStateIgnoresCase |
Context |
NamingContainer |
Visible |
Controls |
Page |
Width |
ControlStyle |
Parent |
|
Methods |
|
|
AddAttributesToRender |
Finalize |
OnLoad |
AddParsedSubObject |
GetHashCode |
OnPreRender |
ApplyStyle |
GetType |
OnUnload |
ClearChildViewState |
HasControls |
RaiseBubbleEvent |
CopyBaseAttributes |
IsLiteralContent |
Render |
ClearChildViewState |
LoadViewState |
RenderBeginTag |
CreateChildControls |
MapPathSecure |
RenderChildren |
CreateControlCollection |
MemberwiseClone |
RenderContents |
CreateControlStyle |
MergeStyle |
RenderControl |
DataBind |
OnBubbleEvent |
RenderEndTag |
Dispose |
OnClick |
ResolveUrl |
Equals |
OnCommand |
SaveViewState |
EnsureChildControls |
OnDataBinding |
ToString |
FindControl |
OnInit |
TrackViewState |
Events |
|
|
Click |
Disposed |
PreRender |
Command |
Init |
Unload |
DataBinding |
Load |
|
Handle the control's Click event to execute code when the user clicks the control. To navigate to another Web page, use the Hyperlink control instead.
ListBox Class
Member of System.Web.UI.WebControls.
The ListBox class represents the ASP.NET server control abstraction of the HTML SELECT element.
Properties |
|
|
|
AccessKey |
DataTextField |
SelectedIndex |
|
Attributes |
DataTextFormatString |
SelectedItem |
|
AutoPostBack |
DataValueField |
SelectionMode |
|
BackColor |
Enabled |
Site |
|
BorderColor |
EnableViewState |
Style |
|
BorderStyle |
Events |
TabIndex |
|
BorderWidth |
Font |
TagKey |
|
ChildControlsCreated |
ForeColor |
TagName |
|
ClientID |
HasChildViewState |
TemplateSourceDirectory |
|
Context |
Height |
Text |
|
Controls |
ID |
ToolTip |
|
ControlStyle |
IsTrackingViewState |
UniqueID |
|
ControlStyleCreated |
NamingContainer |
ViewState |
|
CssClass |
Page |
ViewStateIgnoresCase |
|
DataMember |
Parent |
Visible |
|
DataSource |
Rows |
Width |
|
Methods |
|
|
|
AddAttributesToRender |
Finalize |
OnSelectedIndexChanged |
|
AddParsedSubObject |
GetHashCode |
OnUnload |
|
ApplyStyle |
GetType |
RaiseBubbleEvent |
|
ClearChildViewState |
HasControls |
Render |
|
CopyBaseAttributes |
IsLiteralContent |
RenderBeginTag |
|
ClearChildViewState |
LoadViewState |
RenderChildren |
|
CreateChildControls |
MapPathSecure |
RenderContents |
|
CreateControlCollection |
MemberwiseClone |
RenderControl |
|
CreateControlStyle |
MergeStyle |
RenderEndTag |
|
DataBind |
OnBubbleEvent |
ResolveUrl |
|
Dispose |
OnDataBinding |
SaveViewState |
|
Equals |
OnInit |
ToString |
|
EnsureChildControls |
OnLoad |
TrackViewState |
|
FindControl |
OnPreRender |
|
Page Class
The Page class represents a page request. All controls on a page, as well as utility objects such as Request, Response, Server, and Application (familiar to ASP.old developers), are members of the Page object in ASP.NET.
The page class is the base class from which all ASP.NET pages derive. If you create a code-behind class, it must inherit from this object.
Properties |
|
|
|||
Application |
Cache |
ClientID |
|||
ClientTarget |
Controls |
EnableViewState |
|||
ErrorPage |
ID |
IsPostBack |
|||
IsValid |
NamingContainer |
Page |
|||
Parent |
Request |
Response |
|||
Server |
Session |
Site |
|||
SmartNavigation |
TemplateSourceDirectory |
Trace |
|||
UniqueID Visible |
User |
Validators |
|||
Methods |
|
|
|||
DataBind |
DesignerInitialize |
|
|||
Dispose |
Equals |
|
|||
FindControl |
GetHashCode |
|
|||
GetPostBackClientEvent |
GetPostBackClientHyperlink |
|
|||
GetPostBackEventReference |
GetType |
|
|||
GetTypeHashCode |
HasControls |
|
|||
InstantiateIn |
IsClientScriptBlockRegistered |
|
|||
IsStartupScriptRegistered |
LoadControl |
|
|||
LoadTemplate |
MapPath |
|
|||
ParseControl |
RegisterArrayDeclaration |
|
|||
RegisterClientScriptBlock |
RegisterHiddenField |
|
|||
RegisterOnSubmitStatement |
RegisterRequiresPostBack |
|
|||
RegisterRequiresRaiseEvent |
RegisterStartupScript |
|
|||
RegisterViewStateHandler |
RenderControl |
|
|||
ResolveUrl |
SetRenderMethodDelegate |
|
|||
ToString |
Validate |
|
|||
Events |
|
|
|||
AbortTransaction |
CommitTransaction |
DataBinding |
|||
Disposed |
Error |
Init |
|||
Load |
PreRender |
Unload |
It's common for ASP.NET pages to handle the Load event of the Page object as a way to perform initialization when the page loads.
Panel Class
Member of System.Web.UI.WebControls.
The Panel class enables developers to group Web form controls. You may do this for cosmetic purposes (for example, to group the controls on a complicated form into subcategories) or to manipulate controls on a form as a unit.
Properties |
|
|
|
AccessKey |
Enabled |
Style |
|
Attributes |
EnableViewState |
TabIndex |
|
BackColor |
Events |
TagKey |
|
BackImageUrl |
Font |
TagName |
|
BorderColor |
ForeColor |
TemplateSourceDirectory |
|
BorderStyle |
HasChildViewState |
ToolTip |
|
BorderWidth |
Height |
UniqueID |
|
ChildControlsCreated |
HorizontalAlign |
ViewState |
|
ClientID |
ID |
ViewStateIgnoresCase |
|
Context |
IsTrackingViewState |
Visible |
|
Controls |
NamingContainer |
Width |
|
ControlStyle |
Page |
Wrap |
|
ControlStyleCreated |
Parent |
|
|
CssClass |
Site |
|
|
Methods |
|
|
|
AddAttributesToRender |
Finalize |
OnSelectedIndexChanged |
|
AddParsedSubObject |
GetHashCode |
OnUnload |
|
ApplyStyle |
GetType |
RaiseBubbleEvent |
|
ClearChildViewState |
HasControls |
Render |
|
CopyBaseAttributes |
IsLiteralContent |
RenderBeginTag |
|
ClearChildViewState |
LoadViewState |
RenderChildren |
|
CreateChildControls |
MapPathSecure |
RenderContents |
|
CreateControlCollection |
MemberwiseClone |
RenderControl |
|
CreateControlStyle |
MergeStyle |
RenderEndTag |
|
DataBind |
OnBubbleEvent |
ResolveUrl |
|
Dispose |
OnDataBinding |
SaveViewState |
|
Equals |
OnInit |
ToString |
|
EnsureChildControls |
OnLoad |
TrackViewState |
|
FindControl |
OnPreRender |
|
RadioButton Class
Member of System.Web.UI.WebControls.
The RadioButton class represents the ASP.NET server control abstraction of the INPUT-type radio. Radio buttons are grouped together; only one button in a group may be selected at a time.
Properties |
|
|
|
AccessKey |
Enabled |
Style |
|
Attributes |
EnableViewState |
TabIndex |
|
AutoPostBack |
Events |
TagKey |
|
BackColor |
Font |
TagName |
|
BorderColor |
ForeColor |
TemplateSourceDirectory |
|
BorderStyle |
GroupName |
Text |
|
BorderWidth |
|
TextAlign |
|
Checked |
HasChildViewState |
ToolTip |
|
ChildControlsCreated |
Height |
UniqueID |
|
ClientID |
ID |
ViewState |
|
Context |
IsTrackingViewState |
ViewStateIgnoresCase |
|
Controls |
NamingContainer |
Visible |
|
ControlStyle |
Page |
Width |
|
ControlStyleCreated |
Parent |
Wrap |
|
CssClass |
Site |
|
|
Methods |
|
|
|
AddAttributesToRender |
Finalize |
OnPreRender |
|
AddParsedSubObject |
GetHashCode |
OnUnload |
|
ApplyStyle |
GetType |
RaiseBubbleEvent |
|
ClearChildViewState |
HasControls |
Render |
|
CopyBaseAttributes |
IsLiteralContent |
RenderBeginTag |
|
ClearChildViewState |
LoadViewState |
RenderChildren |
|
CreateChildControls |
MapPathSecure |
RenderContents |
|
CreateControlCollection |
MemberwiseClone |
RenderControl |
|
CreateControlStyle |
MergeStyle |
RenderEndTag |
|
DataBind |
OnBubbleEvent |
ResolveUrl |
|
Dispose |
OnCheckedChanged |
SaveViewState |
|
Equals |
OnDataBinding |
ToString |
|
EnsureChildControls |
OnInit |
TrackViewState |
|
FindControl |
OnLoad |
|
Repeater Class
Member of System.Web.UI.WebControls.
You can use the Repeater control to display bound data in a totally customized way. You do this by creating HTML templates (in a manner similar to the DataList control described earlier in this section).
Properties |
|
|
AlternatingItemTemplate |
FooterTemplate |
Parent |
ChildControlsCreated |
HasChildViewState |
SeparatorTemplate |
ClientID |
HeaderTemplate |
Site |
Context |
ID |
TemplateSourceDirectory |
Controls |
IsTrackingViewState |
UniqueID |
DataMember |
Items |
ViewState |
DataSource |
ItemTemplate |
ViewStateIgnoresCase |
EnableViewState |
NamingContainer |
Visible |
Events |
Page |
|
Methods |
|
|
AddAttributesToRender |
FindControl |
OnItemCreated |
AddParsedSubObject |
Finalize |
OnItemDataBound |
ApplyStyle |
GetHashCode |
OnLoad |
ClearChildViewState |
GetType |
OnPreRender |
CopyBaseAttributes |
HasControls |
OnUnload |
ClearChildViewState |
IsLiteralContent |
RaiseBubbleEvent |
AddParsedSubObject |
LoadViewState |
Render |
ClearChildViewState |
MapPathSecure |
RenderChildren |
CreateChildControls |
MemberwiseClone |
RenderControl |
CreateControlCollection |
MergeStyle |
ResolveUrl |
DataBind |
OnBubbleEvent |
SaveViewState |
Dispose |
OnDataBinding |
ToString |
Equals |
OnInit |
TrackViewState |
EnsureChildControls |
OnItemCommand |
|
Listing 3.35 shows an example of a Repeater control used to display the contents of the ever-popular Hashtable object. Although you could have used another list control such as the DataGrid or DataList to perform the same work, you can see from the code that the Repeater gives you the capability to embed HTML formatting to have more granular control over the formatting of each row.
Listing 3.35 Using the Repeater Control to Build Customized Output of a Hashtable
<%@ Page Language="VB" debug="true" %> <html> <head> <script runat="server"> Sub Page_Load(Sender As Object, e As EventArgs) If Not IsPostBack Then Dim h As Hashtable = new Hashtable() h.Add ("SF", "San Francisco") h.Add ("AZ", "Arizona") h.Add ("CO", "Colorado") h.Add ("SD", "San Diego") h.Add ("LA", "Los Angeles") Repeater1.DataSource = h Repeater1.DataBind End If End Sub </script> </head> <body> <form runat=server> <asp:Repeater id=Repeater1 runat="server"> <HeaderTemplate> <table border="0" cellpadding="5" cellspacing="1" bgcolor="#000000"> <tr> <td bgcolor="#FFFF99"><b>Team</b></td> <td bgcolor="#FFFF99"><b>Abbreviation</b></td> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td bgcolor="#FFFFFF"> <%# DataBinder.Eval(Container.DataItem, "Value") %> </td> <td bgcolor="#FFFFFF"> <%# DataBinder.Eval(Container.DataItem, "Key") %> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> </form> </body> </html>
Remember that the Repeater, like all bound controls, can be bound to any list element, not just the Hashtable.
Note, too, that nothing about the Repeater control necessitates outputting data in an HTML table; you can use the Repeater to render data as a comma-delimited list or as a single-column list with line break (BR) elements, for example.
Table Class
Member of System.Web.UI.WebControls.
The Table class is the ASP.NET server control abstraction of the HTML TABLE element.
Properties |
|
|
||
AccessKey |
CssClass |
Rows |
||
Attributes |
Enabled |
Site |
||
BackColor |
EnableViewState |
Style |
||
BackImageUrl |
Events |
TabIndex |
||
BackColor |
Font |
TagKey |
||
BorderStyle |
ForeColor |
TagName |
||
BorderWidth |
GridLines |
TemplateSourceDirectory |
||
CellPadding |
HasChildViewState |
ToolTip |
||
CellSpacing |
Height |
UniqueID |
||
ChildControlsCreated |
HorizontalAlign |
ViewState |
||
ClientID |
ID |
ViewStateIgnoresCase |
||
Context |
IsTrackingViewState |
Visible |
||
Controls |
NamingContainer |
Width |
||
ControlStyle |
Page |
|
||
ControlStyleCreated |
Parent |
|
||
Methods |
|
|
||
AddAttributesToRender |
FindControl |
OnItemCreated |
||
AddParsedSubObject |
Finalize |
OnItemDataBound |
||
ApplyStyle |
GetHashCode |
OnLoad |
||
ClearChildViewState |
GetType |
OnPreRender |
||
CopyBaseAttributes |
HasControls |
OnUnload |
||
ClearChildViewState |
IsLiteralContent |
RaiseBubbleEvent |
||
AddParsedSubObject |
LoadViewState |
Render |
||
ClearChildViewState |
MapPathSecure |
RenderChildren |
||
CreateChildControls |
MemberwiseClone |
RenderControl |
||
CreateControlCollection |
MergeStyle |
ResolveUrl |
||
DataBind |
OnBubbleEvent |
SaveViewState |
||
Dispose |
OnDataBinding |
ToString |
||
Equals |
OnInit |
TrackViewState |
||
EnsureChildControls |
OnItemCommand |
|
TableCell Class
Member of System.Web.UI.WebControls.
The TableCell class is the ASP.NET server control abstraction of the HTML TD element.
Properties |
|
|
|
AccessKey |
Enabled |
Site |
|
Attributes |
EnableViewState |
Style |
|
BackColor |
Events |
TabIndex |
|
BackColor |
Font |
TagKey |
|
BorderStyle |
ForeColor |
TagName |
|
BorderWidth |
HasChildViewState |
TemplateSourceDirectory |
|
ChildControlsCreated |
Height |
Text |
|
ClientID |
HorizontalAlign |
ToolTip |
|
ColumnSpan |
ID |
UniqueID |
|
Context |
IsTrackingViewState |
VerticalAlign |
|
Controls |
NamingContainer |
ViewState |
|
ControlStyle |
Page |
ViewStateIgnoresCase |
|
ControlStyleCreated |
Parent |
Visible |
|
CssClass |
RowSpan |
Width |
|
Methods |
|
|
|
AddAttributesToRender |
FindControl |
OnItemCreated |
|
AddParsedSubObject |
Finalize |
OnItemDataBound |
|
ApplyStyle |
GetHashCode |
OnLoad |
|
ClearChildViewState |
GetType |
OnPreRender |
|
CopyBaseAttributes |
HasControls |
OnUnload |
|
ClearChildViewState |
IsLiteralContent |
RaiseBubbleEvent |
|
AddParsedSubObject |
LoadViewState |
Render |
|
ClearChildViewState |
MapPathSecure |
RenderBeginTag |
|
CreateChildControls |
MemberwiseClone |
RenderChildren |
|
CreateControlCollection |
MergeStyle |
RenderControl |
|
DataBind |
OnBubbleEvent |
ResolveUrl |
|
Dispose |
OnDataBinding |
SaveViewState |
|
Equals |
OnInit |
ToString |
|
EnsureChildControls |
OnItemCommand |
TrackViewState |
TableRow Class
Member of System.Web.UI.WebControls.
The TableRow class is the ASP.NET server control abstraction of the HTML TR element.
Properties |
|
|
|
AccessKey |
Enabled |
Site |
|
Attributes |
EnableViewState |
Style |
|
BackColor |
Events |
TabIndex |
|
BackColor |
Font |
TagKey |
|
BorderStyle |
ForeColor |
TagName |
|
BorderWidth |
HasChildViewState |
TemplateSourceDirectory |
|
ChildControlsCreated |
Height |
Text |
|
ClientID |
HorizontalAlign |
ToolTip |
|
ColumnSpan |
ID |
UniqueID |
|
Context |
IsTrackingViewState |
VerticalAlign |
|
Controls |
NamingContainer |
ViewState |
|
ControlStyle |
Page |
ViewStateIgnoresCase |
|
ControlStyleCreated |
Parent |
Visible |
|
CssClass |
RowSpan |
Width |
|
Methods |
|
|
|
AddAttributesToRender |
FindControl |
OnItemCreated |
|
AddParsedSubObject |
Finalize |
OnItemDataBound |
|
ApplyStyle |
GetHashCode |
OnLoad |
|
ClearChildViewState |
GetType |
OnPreRender |
|
CopyBaseAttributes |
HasControls |
OnUnload |
|
ClearChildViewState |
IsLiteralContent |
RaiseBubbleEvent |
|
AddParsedSubObject |
LoadViewState |
Render |
|
ClearChildViewState |
MapPathSecure |
RenderBeginTag |
|
CreateChildControls |
MemberwiseClone |
RenderChildren |
|
CreateControlCollection |
MergeStyle |
RenderControl |
|
DataBind |
OnBubbleEvent |
ResolveUrl |
|
Dispose |
OnDataBinding |
SaveViewState |
|
Equals |
OnInit |
ToString |
|
EnsureChildControls |
OnItemCommand |
TrackViewState |
TextBox Class
Member of System.Web.UI.WebControls.
The TextBox class is the ASP.NET server control abstraction of both the HTML INPUT-type textbox as well as the TEXTAREA element.
Properties |
|
|
|
AccessKey |
EnableViewState |
Style |
|
Attributes |
Events |
TabIndex |
|
AutoPostBack |
Font |
TagKey |
|
BackColor |
ForeColor |
TagName |
|
BackColor |
HasChildViewState |
TemplateSourceDirectory |
|
BorderStyle |
Height |
Text |
|
BorderWidth |
HorizontalAlign |
TextMode |
|
ChildControlsCreated |
ID |
ToolTip |
|
ClientID |
IsTrackingViewState |
UniqueID |
|
ColumnSpan |
MaxLength |
VerticalAlign |
|
Context |
NamingContainer |
ViewState |
|
Controls |
Page |
ViewStateIgnoresCase |
|
ControlStyle |
Parent |
Visible |
|
ControlStyleCreated |
ReadOnly |
Width |
|
CssClass |
RowSpan |
Wrap |
|
Enabled |
Site |
|
|
Methods |
|
|
|
AddAttributesToRender |
FindControl |
OnItemCreated |
|
AddParsedSubObject |
Finalize |
OnItemDataBound |
|
ApplyStyle |
GetHashCode |
OnLoad |
|
ClearChildViewState |
GetType |
OnPreRender |
|
CopyBaseAttributes |
HasControls |
OnUnload |
|
ClearChildViewState |
IsLiteralContent |
RaiseBubbleEvent |
|
AddParsedSubObject |
LoadViewState |
Render |
|
ClearChildViewState |
MapPathSecure |
RenderBeginTag |
|
CreateChildControls |
MemberwiseClone |
RenderChildren |
|
CreateControlCollection |
MergeStyle |
RenderControl |
|
DataBind |
OnBubbleEvent |
ResolveUrl |
|
Dispose |
OnDataBinding |
SaveViewState |
|
Equals |
OnInit |
ToString |
|
EnsureChildControls |
OnItemCommand |
TrackViewState |
WebControl Class
Member of System.Web.UI.Webcontrol. Abstract class.
The WebControl class serves as the base class for Web controls.
Properties |
|
|
|
AccessKey |
Enabled |
Style |
|
Attributes |
EnableViewState |
TabIndex |
|
BackColor |
Events |
TagKey |
|
BorderColor |
Font |
TagName |
|
BorderStyle |
ForeColor |
TemplateSourceDirectory |
|
BorderWidth |
HasChildViewState |
ToolTip |
|
ChildControlsCreated |
Height |
UniqueID |
|
ClientID |
ID |
ViewState |
|
Context |
IsTrackingViewState |
ViewStateIgnoresCase |
|
Controls |
NamingContainer |
Visible |
|
ControlStyle |
Page |
Width |
|
ControlStyleCreated |
Parent |
|
|
CssClass |
Site |
|
|
Methods |
|
|
|
AddAttributesToRender |
FindControl |
OnUnload |
|
AddParsedSubObject |
FindControl |
RaiseBubbleEvent |
|
ApplyStyle |
GetHashCode |
Render |
|
BuildProfileTree |
GetType |
RenderBeginTag |
|
ClearChildViewState |
HasControls |
RenderChildren |
|
CopyBaseAttributes |
IsLiteralContent |
RenderContents |
|
CreateChildControls |
LoadViewState |
RenderControl |
|
CreateControlCollection |
MemberwiseClone |
RenderEndTag |
|
CreateControlStyle |
MergeStyle |
ResolveUrl |
|
DataBind |
OnBubbleEvent |
SaveViewState |
|
Dispose |
OnDataBinding |
SetRenderMethodDelegate |
|
EnsureChildControls |
OnInit |
ToString |
|
Equals |
OnLoad |
TrackViewState |
|
Finalize |
OnPreRender |
|
|
Events |
|
|
|
DataBinding |
Init |
PreRender |
|
Disposed |
Load |
Unload |