I need some help with the following.
I have a list view that I fill with code-behind:
Linq->Sql:
ListView1.DataSource = from x in database.ITEMS
select x;
ListView1.DataBind();
Content of ITEMS:
- ID
- Name
- Quantity
I only show the name of the fields:
<tr>
<td>
<asp:Label ID="nameLabel" runat="server" Text='<%# Eval("Name") %>' />
</td>
</tr>
Assuming I have 25 rows in the database, I fill the list view with 25 rows. Next is what I need help with. The user needs to click one of the 25 names (complete row) and redirects to a page where the content of that row is showed. So lets say someone clicks on "Cars", he'll be redirected and he will see: You have selected Cars, Cars has an ID of 19 and a Quantity of 6.
I have browsed the Internet already but I am having trouble finding solutions that I can understand. I am kind of a noob when it comes to list views and other data displaying methods.
My 2 questions:
- How do I start a event when I click a row (and not a button or a link in that row)?
- When I click a row and start a event, how can I check which one was clicked?
I hope someone can explain to me how this is done in a user friendly noob kind of way or redirect me to a tutorial discussing my issue's and also in a user friendly way. Thanks in advance.