|
-
May 20th, 2003, 04:58 PM
#1
Thread Starter
Hyperactive Member
Template and Link button * Resolved *
Hi all, I have a datalist that I use in conjunction with a template to display records retrieved from a database. Datalist is databound to a dataset
What I would like to be able to do is add in a link button to each record in the template that when clicked captures the associated description of the record.
Below is my code for displaying just the description field in the dataset
VB Code:
<ItemTemplate>
<span class="header">Description</span><br>
<%# DataBinder.Eval(Container.DataItem, "Description")%>
</ItemTemplate>
I realise that I can add in a link button to the template like so
VB Code:
<asp:LinkButton ID="lnkMe" Runat="server">Add me</asp:LinkButton>
How can I utilise the above link button to store the associated description in a collection when a user clicks on a records link button?
I would prefer to do it in code-behind in my index.aspx.vb page
Thanks in advance
MarkusJ
Last edited by MarkusJ_NZ; May 20th, 2003 at 09:26 PM.
-
May 20th, 2003, 06:33 PM
#2
Lively Member
Code:
<asp:LinkButton ID="lnkMe" Runat="server" commandname="cmdName" commandargument='<%# DataBinder.Eval(Container.DataItem, "Description")%>'>Add me</asp:LinkButton>
"Find all you need in your mind if you take the time" -DT
-
May 20th, 2003, 09:27 PM
#3
Thread Starter
Hyperactive Member
Hi, thanks for the information, I was trying to focus on individual link buttons instead of relying on event bubbling via the Datagrid.
Thanks again
MarkusJ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|