BulletedList.BulletedList Constructor

Initializes a new instance of the BulletedList class.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public:
BulletedList ()
public BulletedList ()
public function BulletedList ()
Not applicable.

Use the BulletedList constructor to initialize a new instance of the BulletedList class.

The following code example demonstrates how to initialize a new instance of the BulletedList class.

<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>BulletedList Constructor Example</title>
<script runat="server">

        Sub Button1_Click(ByVal Sender As Object, ByVal e As EventArgs)
            ' Create a BulletedList control.
            Dim CompaniesBulletedList As New BulletedList

            ' Add the list items to the BulletedList control.
            CompaniesBulletedList.Items.Add("Coho Winery")
            CompaniesBulletedList.Items.Add("Contoso, Ltd.")
            CompaniesBulletedList.Items.Add("Tailspin Toys")

            ' Add the BulletedList control to the Controls collection
            ' of the PlaceHolder control.
            Place.Controls.Add(CompaniesBulletedList)

        End Sub

   </script>
 
</head>
<body>

    <form id="form1" runat="server">

        <h3>BulletedList Constructor Example</h3>
        
        <asp:PlaceHolder id="Place" 
            runat="server">
        </asp:PlaceHolder>
 
        <hr />

        <asp:Button id="Button1" 
            Text="Create and Show a BulletedList" 
            OnClick="Button1_Click" 
            runat="server"/>  
 
    </form>
   
</body>
</html>

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: