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";

  

Comments

No Comments

The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.