---
title: "how use listview in asp.net?"  
description: "how use listview in asp.net?"  
author: "Somesh"  
published: 2010-11-08  
updated: 2010-11-13  
canonical: https://www.mindstick.com/forum/77/how-use-listview-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# how use listview in asp.net?

we use two [listview](https://www.mindstick.com/articles/12744/listview-in-android) as\
\
<[asp](https://www.mindstick.com/articles/751/introduction-to-asp-dot-net-mvc):ListView id="lv1">\
<[item](https://www.mindstick.com/forum/156564/remove-item-in-an-array-in-javascript) [template](https://www.mindstick.com/blog/282/creating-custom-template-in-joomla)>\
<asp:ListView id="lv2">...</asp:ListView>\
</item template>\
</asp:ListView>\
\
My [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) ,how bind the both listview as given example \
please give [sample](https://www.mindstick.com/news/2174/mars-mission-by-nasa-prepares-for-tests) of this example

## Replies

### Reply by Anonymous User

Hello Yash,

You can accomplish this task by initializing the DataSource of your second ListView.

Here is the code for .aspx file

```
<asp:ListView ID="lv1" runat="server" onitemdatabound="lv1_ItemDataBound">
<ItemTemplate>
<asp:ListView ID="lv2" runat="server">                    .
.
.
</asp:ListView>
</ItemTemplate>
</asp:ListView>
```

Now, write code for DataSource of lv1 in Page_Load event and for lv2 in ItemDataBound of lv1. But remember to find lv2 in lv1 in order to point to lv2.

Here is the code for finding lv2.

```
ListView lv2 = e.Item.FindControl("lv2") as ListView;
```

Now you can use DataBound Property of lv2;

For further details refer to this forum post:

**http://www.mindstick.com/Forum/45/ItemCommand%20Event%20in%20Nested%20Repeater%20and%20listview**

**Hope this will help you.![how use listview in asp.net?](https://www.mindstick.com/app_images/htmleditor.icons/msp_rolleyes.gif)**


---

Original Source: https://www.mindstick.com/forum/77/how-use-listview-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
