Onlineatoz.net | Toolbox Standard Control BulletedList

Toolbox Standard Control BulletedList

BulletedList Web Server Control

The BulletedList Web server control can be used create ordered(numbered) or unordered lists of items, which render as HTML ul or ol elements, respectively. To specify the individual items in the list, place a ListItem control for each list entry between the opening and closing tags of the BulletedList control.

Set Item Display Mode

The BulletedList control can display list items as any of the following:

  • Static text -The text displayed by the control is not interactive.
  • HyperLink controls-Users can click links to navigate to another page.
  • LinkButton controls - Users can click individual items and the control performs a postback.
Set List Item Styles

you can select from predefined bullet styles, such as:

  • Disc
  • Circle
  • Square
Adding List Item

You can add items to a list Web server control in these ways:

  • Add static items at design time.
  • Add items programmatically at run time.
to add static items at design time

you simply include the folloing codes in your web page:

<asp:ListBox ID="ListBox1" runat="server">
<asp:ListItem Text="Red" Value="#FF0000" Selected="True" />
<asp:ListItem Text="Blue" Value="#0000FF" />
<asp:ListItem Text="Green" Value="#008000" />
</asp:ListBox><br />
 
to Add items programmatically at run time.

you simply include the folloing codes in your code page:

Protected void Button1_Click (object sender, System.EventArgs e)
{
ListBox1.Items.Add(new ListItem("Carbon", "C"));
ListBox1.Items.Add(new ListItem("Oxygen", "O"));
}
Related Links

Posted by: Admin
Posted on: 9/13/2011 at 12:24 PM
Categories: Asp.net
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed