• home
  • Email: trainings@synapseindia.careers

Blogs

back

How to add items in bulletedList control in ASP.NET

Oct 10, 2015

The BulletedList control creates an unordered or ordered (numbered) list of items, which renders as an HTML ul or ol element, respectively. You can specify the appearance of the items and of the bullets or numbers, define the list items statically or by binding the control to data, and you can respond to users' clicks on items.

You can add items in bulletedlist in three ways :

First Way:

By using Items Property.

A.Drag the BulletedList control to the web page. B.Click on the Items Property and add the Text and Values four times. C.Select the appropriate Display Mode . D.Select the appropriate BulletStyle accordingly . E.Be careful while using DisplayMode "HyperLink" because in that case u need do define the NavigationUrl to the Value attribute of the ListItem.

Second Way :

By using Programatically at design time. <asp:BulletedList ID="blt" BulletStyle="Numbered" DisplayMode="HyperLink" runat="server" > <asp:ListItem Value="https://www.google.com">One</asp:ListItem> <asp:ListItem>Two</asp:ListItem> <asp:ListItem>Three</asp:ListItem> <asp:ListItem>Four</asp:ListItem> <asp:ListItem>Fifth</asp:ListItem> </asp:BulletedList>

Third Way :

By programmaticaly at run time . protected void Button1_Click(object sender, EventArgs e) { blt.Items.Add(new ListItem("Five","https://wwww.acplm.com")); blt.Items.Add(new ListItem("Six","https://wwww.acplm.com")); blt.Items.Add(new ListItem("Seven","https://wwww.acplm.com")); blt.Items.Add(new ListItem("Eight","https://wwww.acplm.com")); blt.Items.Add(new ListItem("Nine","https://wwww.acplm.com"));

}

SynapseIndia is a leading website and mobile app development company. IT Mentor & an Entrepreneur SynapseIndia CEO Shamit Khemka spread their business across the globe. They have more than 500 full time employees and all the experts at SynapseIndia working in tandem to achieve good feedback from clients having no complaints at all. They have already delivered more than 3000 thousand projects. They pass on complete quality solutions for website development services and getting good reviews on various SynapseIndia PHP Web development projects. The Employment bond is basically an agreement which the company and the employee enter into which among the other terms contained therein states that in consideration of the training given to the Employee and the money spent by the company in imparting such training, the Employee will remain in the services of the company for a particular period.

SynapseIndia (CEO: Shamit Khemka)