Different Usage of BulletedList Control
In addition to display item / text value in a bullet format width different styles, you can also create a list of HyperLink and LinkButton from it by changing its DisplayMode properties:
- Text
- HyperLink
- LinkButton
The name of the DisplayMode property explain its nature and use obviously, and the following two examples can show its features:
<form runat="server">
<h2>Download Presentation/Demo</h2>
<asp:bulletedlist id="demoBulletedList" runat="server"
displaymode="LinkButton"
bulletstyle="Numbered"
tooltip="Download Demo"
onclick="Bulletedlist1_Click">
<asp:ListItem>ASP.NET Tips & Tricks</asp:ListItem>
<asp:ListItem>Operating & Deploying ASP.NET Applications </asp:ListItem><asp:ListItem>ASP.NET Http Runtime </asp:ListItem>
<asp:ListItem>Building Custom ASP.NET Server Controls </asp:ListItem>
</asp:bulletedlist>
<br />
<asp:label id="messageLabel" runat="Server" />
</form>
Server Code:
void Bulletedlist1_Click(object sender, System.Web.UI.WebControls.BulletedListEventArgs e) {
// WriteFile here
messageLabel.Text = "You've downloaded the Presenation # " + (e.Index + 1).ToString() ;
}
Screen Shot:
Conclusion
One of the features of ASP.NET v2.0 is developer productivity, while the creation of BulletedList control is obviously save a lots of codes to be written and a common feedback of existing ASP.NET 1.* developers.
With the use of datasourceid property of the BulletedList control, developer can retrieve data from anyDataSourceControl and display them in a bullet format easily in ASP.NET v2.0
The addition of (SmartTag) wizard for server control provide a user friendly configuration tool for developers. This BulletedList control can save the development time and avoid the overkill of repeater control as in ASP.NET 1.*
Version Note
This article was based on an early Alpha release of ASP.NET v2.0 and VS.NET Whidbey. It is possible that some implementation or v1.* compatibility details will change.