Prev | Current Page 544 | Next

Rob Cameron and Dale Michalk

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

We define ???title
case??? as text in which the first letter of every word is capitalized. The server control inherits
from System.Web.UI.ExtenderControl, as you would expect, since it is an extender control.
The associated client-side component named TextCaseBehavior is located in
ControlsBook2Lib.Ch09.TextCaseBehavior.js. The client-side component is accessible
as an embedded resource through the implementation of GetScriptReferences and
Assembly:WebResource attributes, as described in the ???The GetScriptReferences Method??? section.
CHAPTER 9 ?–  A SP.NET A JAX C ONTROLS AND EXTENDERS 427
The control declares an enumeration type TextCaseStyle with three possible values:
LowerCase, TitleCase, and UpperCase. TextCaseStyle is the type for the CaseStyle property of the
extender server control. The CaseStyle property is configured to use ViewState as you would expect
and also is decorated with the Bindable, Category, DefaultValue, and Localizable attributes.
In the GetScriptDescriptors method, the CaseStyle property is set on the client-side
component so that it knows how to enforce the case on the target control. For more information
on the GetScriptDescriptors see the ???The GetScriptDescriptors Method??? section.


Pages:
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556