Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 2700 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > ASP.NET > How to use BulletedList in asp.net ...
Ranjeet_8

How to use BulletedList in asp.net

 Code Snippet posted by: Ranjeet_8 | Posted on: 9/1/2012 | Category: ASP.NET Codes | Views: 626 | Status: [Member] | Points: 40 | Alert Moderator   


ASPX design page :

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Testing Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server">
</asp:Label>
<asp:BulletedList ID="BulletedList1" runat="server" Font-Names="Comic Sans MS" Font-Underline="true"
Font-Size="XLarge" OnDataBound="BulletedList_DataBound" ForeColor="CadetBlue">
</asp:BulletedList>
<br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Click Me"
Height="45" Font-Bold="true" ForeColor="DodgerBlue" />
</div>
</form>
</body>
</html>

Add this code on C#

protected void Button1_Click(object sender, System.EventArgs e)
{
string[] colors = { "Potato", "Red", "Green", "Silver", "Black" };
BulletedList1.DataSource = colors;
BulletedList1.DataBind();
}

protected void BulletedList_DataBound(object sender, EventArgs e)
{
Label1.Text = "Color List";
Label1.ForeColor = System.Drawing.Color.DeepSkyBlue;
Label1.Font.Name = "Arial";
Label1.Font.Underline = true;
Label1.Font.Size = FontUnit.XLarge;
BulletedList1.DisplayMode = BulletedListDisplayMode.LinkButton;
BulletedList1.Items[1].Enabled = false;
}

Found interesting? Add this to:


 Responses

T.Saravanan
Posted by: T.Saravanan | Posted on: 9/3/2012 | Level: Silver | Status: [Member] [MVP] | Points: 10 | Alert Moderator 

Hi,

Could you explain little bit about Bulleted List and its uses then post your code?
That is the way user easily to understand your code and uses of Bulleted List. Without explanation there is no use for viewers.

please update your code.

Thanks,
T.Saravanan

>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/19/2013 7:33:44 AM