How to Databind to a Listview
- 1). Open Visual Studio, select the Web site project and ASPX file that you intend to modify. Click the "Design Mode" button on the ASPX page.
- 2). Click on the Toolbox list at the left and locate the ListView control. Drag and drop the ListView control onto the ASPX page in design mode.
- 3). Locate the data source you intend to use or drag and drop a new data source control from the Toolbox.
- 4). Click on the ListView control. Click on the Properties window that appears on the right corner of the control and choose the "DataBind" option. Select the data source and follow the steps presented to configure the data bindings. These steps will vary with the type of data source you're using.
- 5). Click on the ASPX file and click the "Debug" icon to run the code and see that it performs as expected.
Source...