TAILIEUCHUNG - Professional ASP.NET 3.5 in C# and Visual Basic Part 125

Professional in C# and Visual Basic Part 125. 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 Is GetType WebUserControl Then This control is not participating in Outputcache CType c1 WebUserControl .ID myWebUserControll CType c1 WebUserControl .Text My users controls text Elself Is GetType PartialCachingControl And _ CType c1 PartialCachingControl .CachedControl IsNot Nothing Then The control is participating in output cache but has expired Dim myWebUserControl as WebUserControl _ CType CType c1 PartialCachingControl .CachedControl _ WebUserControl myWebUserControl1 My users controls text End If End Sub script C script runat server void Page_Load object sender EventArgs e Control myForm Form1 Control cl LoadControl c1 if c1 is WebUserControl This control is not participating in OutputCache WebUserControl c1 .ID myWebUserControl1 WebUserControl c1 .Text My users controls text else if c1 is PartialCachingControl PartialCachingControl c1 .CachedControl null The control is participating in output cache but has expired WebUserControl myWebUserControl WebUserControl PartialCachingControl c1 .CachedControl myWebUserControl1 My users controls text script The sample demonstrates how you can test to see what type the LoadControl returns and set properties based on the type. For more information on caching check out Chapter 23. Finally in all the previous samples that demonstrate dynamically adding user controls the user controls have been added during the Page_Load event. But there may be times when you want to add the control based on other events such as a button s Click event or the SelectedIndexChanged event of a DropDownList control. Using these events to add user controls dynamically presents challenges. Specifically because the events may not be raised each time a page postback occurs you need to create a way to track when a user control has been added so that .

TỪ KHÓA LIÊN QUAN
Đã 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.