Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
HI Buddies,


i m new to ASP ....is there any control like 'groupbox' in C#..for putting 2 controls(radio buttons) in a single control(like panneling)????


plz
i m waiting
Posted
Updated 13-Oct-11 2:36am
v2
Comments
Mehdi Gholam 13-Oct-11 8:36am    
EDIT-> title edited

You have to use Panel Control and for the title use the GroupingText property.
XML
<asp:Panel ID="Panel1" runat="server" GroupingText="My Group" Width="200px">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br/>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</asp:Panel>
 
Share this answer
 
To group a set of radiobuttons you will have to set the GroupName Property for all the radio buttons.

If you are looking for a groupbox like container(winforms) in ASP.NET then it is not present but you can use RadioButtonList to mimic the similar functionality.
 
Share this answer
 
v2
HTML
<asp:Panel ID="Panel1" runat="server" GroupingText="My Group" Width="200px">
   <asp:TextBox ID="TextBox2" runat="server" /><br/>
   <asp:TextBox ID="TextBox3" runat="server" />
</asp:Panel>
 
Share this answer
 
v2
Comments
StianSandberg 18-Jul-12 4:17am    
A panel with GroupingText will produce a html fieldset with legend. See example:
http://www.w3schools.com/aspnet/prop_webcontrol_panel_groupingtext.asp
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900