Skip to Content
Beginning ASP.NET 3.5: In C# and VB
book

Beginning ASP.NET 3.5: In C# and VB

by Imar Spaanjaars
March 2008
Intermediate to advanced content levelIntermediate to advanced
766 pages
21h 15m
English
Wrox
Content preview from Beginning ASP.NET 3.5: In C# and VB

A.4. Chapter 4

A.4.1.

A.4.1.1.
A.4.1.1.1. Exercise 1 solution

The mechanism that enables controls to maintain their state is called ViewState.

A.4.1.1.2. Exercise 2 solution

The ASP.NET run time stores the values for the controls on a hidden field called __VIEWSTATE. This hidden field is sent with each postback to the server, where it's unpacked and then used to repopulate the controls in the page with their previous values.

A.4.1.1.3. Exercise 3 solution

The DropDownList only allows a user to make a single selection whereas the ListBox allows for multiple selections. In addition, the DropDownList only shows one item in the list when it's not expanded, while the ListBox is capable of displaying multiple items simultaneously.

A.4.1.1.4. Exercise 4 solution

In order to have a CheckBox control submit back to the server when you select or clear it in the browser, you need to set the AutoPostBack property to True:

<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" />
A.4.1.1.5. Exercise 5 solution

Many of the ASP.NET Server Controls let you change colors using properties like BackColor and ForeColor. Additionally, you can use BorderColor, BorderStyle, and BorderWidth to change the border around a control in the browser. Finally, to affect the size of the control, you need to set its Height and Width properties.

A.4.1.1.6. Exercise 6 solution

Instead of setting individual style properties as listed in the previous exercise, you're much better off setting the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning ASP.NET 4: in C# and VB

Beginning ASP.NET 4: in C# and VB

Imar Spaanjaars
Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Bill Evjen, Scott Hanselman, Devin Rader

Publisher Resources

ISBN: 9780470187593Purchase book