asp.net Panel with scroll bar

If you want to set vertical scroll bars with Panel by applying CSS ScrollBars="Vertical" only then it will not work perfect. In addition to ScrollBars, you need to apply one more css property wrap="false".

<asp:Panel ID="myPanelID" runat="Server" Height="300px" Width="400px" ScrollBars="Vertical" Wrap="false"


It is better to use DIV instead of panel for a scroll bar based container. If you can't avoid the usage of Panel somehow, then this panel can be also placed inside that DIV element. And the container DIV will maintain the scrollbar features smartly for you.

<div id="myDivForPanelScroll" 
    style="overflow-y: auto;
           height: 300px;
           width: 800px;"
>
//here your panel etc. come
</div>