TAILIEUCHUNG - ASP.NET 4 Unleased - p 15

Việc kiểm soát Panel hỗ trợ các thuộc tính sau đây (điều này không phải là một danh sách đầy đủ):. DefaultButton-Cho phép bạn chỉ định nút mặc định trong một Panel. Các nút mặc định được gọi khi bạn nhấn nút. . Hướng-Cho phép bạn để có được, hoặc thiết lập theo hướng mà trong đó điều khiển hiển thị văn bản được trả lại. | 114 CHAPTER 2 Using the Standard Controls The Panel control supports the following properties this is not a complete list DefaultButton Enables you to specify the default button in a Panel. The default button is invoked when you press the Enter button. Direction Enables you to get or set the direction in which controls that display text are rendered. Possible values are NotSet LeftToRight and RightToLeft. GroupingText Enables you to render the Panel control as a fieldset with a particular legend. HorizontalAlign Enables you to specify the horizontal alignment of the contents of the Panel. Possible values are Center Justify Left NotSet and Right. ScrollBars Enables you to display scrollbars around the panel s contents. Possible values are Auto Both Horizontal None and Vertical. By default a Panel control renders a div tag around its contents. If you set the GroupingText property however the Panel control renders a fieldset tag. The value that you assign to the GroupingText property appears in the fieldset tag s legend tag. Listing demonstrates how you can use the GroupingText property see Figure . LISTING @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD html xmlns http 1999 xhtml head id Head1 runat server title Panel Grouping Text title head body form id form1 runat server div asp Panel id pnlContact GroupingText Contact Information Runat server asp Label id lblFirstName Text First Name AssociatedControlID txtFirstName Runat server br asp TextBox id txtFirstName From the Library of Wow eBook Using the Panel Control 115 AutoCompleteType FirstName Runat server br br asp Label id lblLastname Text Last Name AssociatedControlID txtLastName Runat server br asp TextBox id txtLastName AutoCompleteType LastName Runat server br br asp Button id btnSubmit Text Submit Runat server 2 asp Panel div form body html FIGURE Setting the GroupingText .