2

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 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.