Thanks! perfect solution!
Main Topics
Browse All TopicsI'm using a repeater to list rows in a table. I have a button for each row. On click, I want to know the ID of the row.
I can store the ID in a hidden field, but is there a better way?
Also, I want to know another value that I don't wish to display, should I use a hidden field?
Then on the ItemCommand, what do I do to know the button has been clicked and if so, retrieve the values in those hidden fields, or ID's via other means you suggest?
Please provide the code in VB if possible, or C# if you can't. I can convert. But don't direct me to a page unless it specifically answers this question, as I've been looking all morning for something like this, and I do get tired of those who google stuff like "ItemCommand" and post a link and hope to get points for doing what I've already done and not bothering to answer the question.
thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: guru_samiPosted on 2009-09-15 at 11:14:42ID: 25337627
set CommandName="cmdEdit" for you button in the markup ..
l source As Object, ByVal e As RepeaterCommandEventArgs) , Button) iner.FindC ontrol("Hi ddenField1 "), HiddenField)
then the item command should look something like below:
Protected Sub Repeater1_ItemCommand(ByVa
If e.CommandName = "cmdEdit" Then
Dim btn As Button = DirectCast(e.CommandSource
If btn IsNot Nothing Then
Dim hf1 As HiddenField = DirectCast(btn.NamingConta
If hf1 IsNot Nothing Then
Dim value As String = hf1.Value
End If
End If
End If
End Sub
Instead of HiddenField other way would be multiple arguments in CommandArgument