Create a Windows-style GroupBox in ASP.NET
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.
Popular Articles
Last viewed:
- SQL Create Table Add Description to Column
- Launch URL in Default Browser using C#
- C# Download File with Progress Bar
- Performance benchmarks for LINQ vs. SqlDataReader, DataSet - LINQ Compiled Queries: Part 2
- Web.config Settings Editor Control
- Fixing Relative Paths in C# ASP.NET When Using Url Rewriting
Recent comments
- Never seen this issue
3 days 5 hours ago - Error in query.ToList()
3 days 8 hours ago - Thanks
3 days 21 hours ago - Thanks
6 days 19 hours ago - To get the data working,
1 week 2 days ago - If I manually change the
1 week 2 days ago - Handling EDM Relationship Metadata
1 week 2 days ago - About the itextsharp version
1 week 2 days ago - Not sure
1 week 4 days ago - Green traffic bars
2 weeks 2 days ago
Similar
- Fixing Relative Paths in C# ASP.NET When Using Url Rewriting
- How to Highlight the Day in the ASP.NET Calendar Control with the SelectedDate Property
- Global.asax Events in IIS 6 and IIS 7 for Static Resources
- Changing the Application Pool Identity with Windows Server 2008 and IIS 7
- CSS Shorthands and Input Styling


NICE FIND
Just what i was looking for...
thanks
Grouping Text With Css
Hi,
I need to apply the css for Grouping text property in Panel .... i am not getting code for that pl Help me ...
Thanks in advance
You can try with the FIELDSET
You can try with the FIELDSET / LEGEND html elements, with some CSS work it can be made to look like the windows group and you can also use CSS on the legend text