Professional ASP.NET 3.5 in C# and Visual Basic Part 131

Professional in C# and Visual Basic Part 131. 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 If _currentView 1 Then template View2 End If Dim p As New Panel p If Not template Is Nothing Then p End If End Sub End Class C Designer typeof MultiRegionControlDesigner ToolboxData 0 MultiRegionControl runat server width 100 0 MultiRegionControl public class MultiRegionControl CompositeControl Define the templates that represent 2 views on the control private ITemplate _view1 private ITemplate _view2 These properties are inner properties PersistenceMode DefaultValue null public virtual ITemplate Viewl get return _view1 set _view1 value PersistenceMode DefaultValue null public virtual ITemplate View2 get return _view2 set _view2 value The current view on the control 0 view1 1 view2 2 all views private int _currentView 0 public int CurrentView get return _currentView set _currentView value protected override void CreateChildControls ITemplate template View1 if _currentView 1 template View2 Panel p new Panel p 1261 Chapter 26 User and Server Controls if template null p The container control creates two iTemplate objects which serve as the controls to display. The iTemplate objects are the control containers for this server control allowing you to drop other server controls or text into this control. The control also uses the Designer attribute to indicate to Visual Studio that it should use the MultiRegionControlDesigner class when displaying this control on the designer surface. Now you create the control designer that defines the regions for the control. Listing 26-43 shows the designer class. Listing 26-43 A custom designer class used to define designer regions VB Public Class MultiRegionControlDesigner Inherits Protected _currentView As Int32 0 Private myControl As MultiRegionControl Public Overrides Sub Initialize ByVal .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
147    131    1    14-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.