BulletStyle property : BulletedList « Data Binding « ASP.NET Tutorial






Circle
CustomImage
Disc
LowerAlpha
LowerRoman
NotSet
Numbered
Square
UpperAlpha
UpperRoman



<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Show BulletedList Image</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    <asp:BulletedList
        id="blProducts"
        DataSourceID="srcProducts"
        DataTextField="Title"
        BulletStyle="CustomImage"
        BulletImageUrl="~/Images/Bullet.gif"
        Runat="server" />

    <asp:SqlDataSource
        id="srcProducts"
        SelectCommand="SELECT Title FROM Products"
        ConnectionString="<%$ ConnectionStrings:Products %>"
        Runat="server" />

    </div>
    </form>
</body>
</html>

            
File: Web.config

<configuration>
  <connectionStrings>
    <add name="Products" 
         connectionString="Data Source=.\SQLEXPRESS;
         AttachDbFilename=|DataDirectory|MyDatabase.mdf;Integrated Security=True;User Instance=True" />
  </connectionStrings>
</configuration>








19.2.BulletedList
19.2.1.BulletedList Control data binding with asp:SqlDataSource
19.2.2.BulletStyle property
19.2.3.DisplayMode property: BulletedList DisplayMode enumeration
19.2.4.Simple Page With Data Binding
19.2.5.Page with declarative data binding