DisplayMode property: BulletedList DisplayMode enumeration : BulletedList « Data Binding « ASP.NET Tutorial






HyperLink:      Each list item is rendered as a link to another page.
LinkButton:     Each list item is rendered by a LinkButton control.
Text:           Each list item is rendered as plain text.

<%@ 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 HyperLinks</title>
</head>
<body>
    <form id="form1" runat="server">

    <asp:BulletedList
        id="blWebsites"
        DisplayMode="HyperLink"
        Target="_blank"
        Runat="server">
        <asp:ListItem
            Text="Yahoo"
            Value="http://www.Yahoo.com" />
        <asp:ListItem
            Text="Google"
            Value="http://www.Google.com" />
        <asp:ListItem
            Text="asdf"
            Value="http://www.asdfasdfasdf.com" />
    </asp:BulletedList>

    </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