Reply to comment
Create a Windows-style GroupBox in ASP.NET
Submitted by Ben Hodson on Wed, 01/07/2009 - 17:37
This one took me a little searching but it actually extraordinarily simple to do. In many Windows desktop applications, similar controls are grouped together under a titled category similar to this:

To create this look, there is a really simple way that doesn't require any fancy javascript or CSS positioning. You just use the asp:Panel control. The HTML/ASPX code looks like this:
<asp:panel ID="pnlGroupBox" runat="server" GroupingText="My Group Box Name "> <table border="0" cellpadding="5" cellspacing="0"> <tr> <td> This is the text or other controls that are in my group box. <br /> <br /> You could put a checkbox <asp:CheckBox ID="cbx1" runat="server" /> or a radio button <asp:RadioButton ID="rdo1" runat="server" /> or any other .NET control here. </td> </tr> </table> </asp:panel>
When you add this code to your ASPX page and run it, you should see something similar to this:

This has been tested and works on IE 6.0 or higher, Safari 2.0 or higher, and Firefox 2.0 or higher.
Reply
Popular Articles
Last viewed:
- Silverlight Memory Leak DataGrid, DataForm, DataTemplate, etc...
- Contact Us
- SQL Create Table Add Description to Column
- Performance benchmarks for LINQ vs. SqlDataReader, DataSet - LINQ Compiled Queries: Part 2
- Installing an SSL / TLS certificate on Windows Server 2008
- Install Windws 2003 Terminal Service Licenses (Remote Desktop)


Recent comments
1 day 1 hour ago
1 day 7 hours ago
1 week 1 day ago
1 week 1 day ago
1 week 2 days ago
1 week 5 days ago
2 weeks 1 day ago
2 weeks 1 day ago
2 weeks 1 day ago
2 weeks 1 day ago