It is better not to bind ID. Just SqlDataSource2 will do. ASP.NET only requires the ID to be unique within the NamingContainer. (In this case, the ListViewDataItem.)
Also, if you use HiddenField, like Qin Dian Tang suggests, you can use ControlParameter instead of Parameter. That will pick up the value of the HiddenField automatically, making it work without code-behind.
Superguppie.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
superguppie
All-Star
48225 Points
8679 Posts
Re: Using repeater in Listview
Feb 24, 2012 12:33 PM|LINK
It is better not to bind ID. Just SqlDataSource2 will do. ASP.NET only requires the ID to be unique within the NamingContainer. (In this case, the ListViewDataItem.)
Also, if you use HiddenField, like Qin Dian Tang suggests, you can use ControlParameter instead of Parameter. That will pick up the value of the HiddenField automatically, making it work without code-behind.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.