Prev | Current Page 193 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"


If the EnableViewState property on the page or on the controls is set to false, clicking the
Toggle3d button will enable the Enable3D property on both controls for that postback. However, the
setting of true does not persist between the Submit button clicks; instead, the value reverts to the
default value of false. Listings 3-11 and 3-12 have the code for the TextBox3DControlStateDemo
web form.
CHAPTER 3 ?–  A SP.NET S TATE MANAGEMENT 117
Figure 3-14. TextBox3DControlStateDemo web form at design time
Listing 3-11. The TextBox3DControlStateDemo Web Form .aspx File
<%@ Page Language="C#" MasterPageFile="~/MasterPage/ControlsBook2MasterPage.Master"
AutoEventWireup="true" CodeBehind="TextBox3DControlStateDemo.aspx.cs"
Inherits="ControlsBook2Web.Ch03.TextBox3DControlStateDemo"
Title="Control State Demo" %>
<%@ Register TagPrefix="apressCh02" Namespace="ControlsBook2Lib.Ch02"
Assembly="ControlsBook2Lib" %>
<%@ Register TagPrefix="apressCh03" Namespace="ControlsBook2Lib.Ch03"
Assembly="ControlsBook2Lib" %>

Width="14px">3  ID="ChapterTitleLabel" runat="server" Width="360px">
ASP.


Pages:
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205