I wanted to show 20 items from database using a listview. but those items should be shown in two divs. 10 items in each div. The problem is, how can i build div inside listview itemtemplate for the items in aspx page?
1 Answer
if the level of customization you are looking for is not easi or possible to achieve with customization of the ASP.NET listview ItemTemplate, you can uset the repeater object and customize its ItemTemplate, the repeater has been designed exactly for these cases, it supports data binding and allows you to define / customize totally the layout of items to repeat.
see here: ASP.NET TUTORIAL. HOW TO USE REPEATER
1 Comment
Rashedul.Rubel
thanks for the reply Davide Piras. actually, i am fetching 20 records at a time from database using select query inside asp:sqldatasource tag in aspx page. and then setting that sqldatasource as the datasource of the asp:listview. Now my requirement was to show those 20 items in 2 divs (10 items in each div). for example, first 10 (1 to 10) records in the first div and second 10 (11 to 20) in the second div. how can i toggle div? is this possible using repeater?