ASP.NET ScrollBars property

Definition and usage

The ScrollBars property is used to set or return the position and visibility of the scrollbar in the Panel control.

Syntax

<asp:Panel ScrollBars="value" runat="server">
Some Content
</asp:Panel>
Property Description
value

Specify whether to display the scrollbar.

Possible values:

  • None - Default. Do not show scrollbars.
  • Horizontal - Only show horizontal scrollbars.
  • Vertical - Only show vertical scrollbars.
  • Both - Show both horizontal and vertical scrollbars.
  • Auto - Show horizontal, vertical scrollbars, or both as needed.

Example

The following example sets the ScrollBars property of the Panel control to "Vertical":

<form runat="server">
<asp:Panel id="pan1" runat="server"> 
Height="100px" ScrollBars="Vertical">
Some content
</asp:Panel>
</form>

Example

Set scrollbar behavior for Panel controls