.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> ASP.NET Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

HTML GroupBox in Asp.net

Posted By:Praveen       Posted Date: July 24, 2009    Points: 10    Category: ASP.NET Controls    URL: http://www.dotnetspark.com  
 

To create HTML GroupBox in Asp.net like we have in windows application we have to use html

tag

Lets see an example

Inside the form tag you can write your tag like this to create Group box in asp.net

<form id="form1" runat="server">
<fieldset style="width:140px">
<legend> User Login legend>

fieldset>
form>

tag is used to give the name to a group box.

After end of the tag you can write any HTML tag like Table, Input etc.

In the below example i have taken an example of Login Box inside group.

full code for the example shown in the picture is as below

<fieldset style="width:140px"> 
<
legend> User Login legend>
<
table style="width:100%;">
<
tr>
<td>
<asp:Label ID="lblUserName" runat="server" Text="UserName:">asp:Label>
td>
<td>
<asp:TextBox ID="txtUserName" runat="server" Width="100px">asp:TextBox>
td>
tr>
<tr>
<td>
<asp:Label ID="lblPassword" runat="server" Text="Password:">asp:Label>
td>
<td>
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Width="100px">asp:TextBox>
td>
tr>
<tr>
<td>
 td>
<td>
<asp:Button ID="Button1" runat="server" Text="Login" />
td>
tr>
table>
fieldset>

You can also assign the css of the

tag using style attribute.



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend