tailieunhanh - Professional ASP.NET 3.5 in C# and Visual Basic Part 127

Professional in C# and Visual Basic Part 127. Building on the revolutionary release, adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 26 User and Server Controls Listing 26-18 Sample skin @ Register Assembly WebControlLibrary1 Namespace WebControlLibrary1 TagPrefix cc1 cc1 webcustomcontrol1 BackColor Green runat server By default allows all control properties to be defined in the skin file but obviously this is not always appropriate. Most exposed properties are non-UI related therefore you do not apply a theme to them. By setting the Themeable attribute to False on each of these properties you prevent the application of a theme. Listing 26-19 shows how to do this in your control by disabling themes on the Text property. Listing 26-19 Disabling theme support on a control property VB Bindable True Category Appearance DefaultValue _ Localizable True Themeable False _ Property Text As String Get Dim s As String CStr ViewState Text If s Is Nothing Then Return Else Return s End If End Get Set ByVal Value As String ViewState Text Value End Set End Property C Bindable true Category Appearance DefaultValue Localizable true Themeable false public string Text get String s String ViewState Text return s null s set ViewState Text value Now if a developer attempts to define this property in his skin file he receives a compiler error when the page is executed. 1221 Chapter 26 User and Server Controls Adding Client-Side Features Although the capability to render and style HTML is quite powerful by itself other resources can be sent to the client such as client-side scripts images and resource strings. provides you with some powerful new tools for using client-side scripts in your server controls and retrieving other resources to the client along with the HTML your control emits. Additionally now includes an entire model that allows you to make asynchronous callbacks from your Web page to the server. Emitting Client-Side Script Having your control emit client-side script such as VBScript or JavaScript enables you to add powerful client-side functionality

TỪ KHÓA LIÊN QUAN