ASP.NET ScrollBars Property

Definition and Usage

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

Syntax

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

Specify whether to display the scroll bar.

Possible values:

  • None - Default. Do not show scroll bars.
  • Horizontal - Show only horizontal scroll bars.
  • Vertical - Show only vertical scroll bars.
  • Both - Show both horizontal and vertical scroll bars.
  • Auto - Show horizontal, vertical scroll bars, 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