Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Professional ASP.NET 3.5 in C# and Visual Basic Part 21. Building on the revolutionary ASP.NET 2.0 release, ASP.NET 3.5 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 ASP.NET 2.0 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 3 ASP.NET Web Server Controls The advantage of using the Panel control to encapsulate a set of other elements is that you can manipulate these elements as a single unit using one attribute set in the Panel control itself. For example setting the Font-Bold attribute to True causes each item within the Panel control to adopt this attribute. The new addition to the Panel control is the capability to scroll with scrollbars that appear automatically depending on the amount of information that Panel control holds. You can even specify how the scrollbars should appear. For an example of using scrollbars look at a long version of the Lorem Ipsum text found at www.lipsum. com and place that text within the Panel control as shown in Listing 3-27. Listing 3-27 Using the new scrollbar feature with the Panel server control @ Page Language VB html head runat server title Panel Server Control Page title head body form id form1 runat server asp Panel ID Panel1 runat server Height 300 Width 300 ScrollBars auto p Lorem ipsum dolor sit amet. p asp Panel form body html By assigning values to the Height and Width attributes of the Panel server control and using the ScrollBars attribute in this case set to Auto you can display the information it contains within the defined area using scrollbars see Figure 3-29 . As you can see a single vertical scrollbar has been added to the set area of 300 x 300 pixels. The Panel control wraps the text by default as required. To change this behavior use the new Wrap attribute which takes a Boolean value asp Panel ID Panel1 runat server Height 300 Width 300 ScrollBars Auto Wrap False Turning off wrapping may cause the horizontal scrollbar to turn on depending on what is contained in the panel section . If you do not want to let the ASP.NET engine choose which scrollbars to activate you can actually make that decision by using the ScrollBars attribute. In addition to Auto its values include None Horizontal Vertical and Both. Another interesting