Display Legend In Panel Control

How many of you used group box control when developing Desktop Applications! I used them to group controls on a specific form in a logical more organized way with titles. Now in ASP.NET 2.0 and using Panel web server control, this can be achieved. Below is a sample HTML to demonstrate it

        <asp:Panel ID="Panel1" runat="server" Width="100%" Height="30%">
        <fieldset>
        <legend id="pnlLegend" runat="server">
        Welcome
        </legend>
        </fieldset>
        </asp:Panel>

Adding the fieldset control inside the panel will allow us to add legend to it.

Once you copy this HTML into the Source, go back to the Design mode and check it up.

Don't forget you can treat legend now as a normal html control which can be transformed into HTML server control by adding runat="server" and id="pnlLegend" to set its text from code behind : pnlLegend.InnerText = "Hello World";

  

Published 17 January 2008 01:31 AM by haissam

Comments

No Comments

This site

Search

Go

This Blog

Syndication

Sponsors

  • MaximumASP
  • Social Bookmarking
    Online Shopping
    asp.net hosting
    UK online local dating