Yahoo Clever wird am 4. Mai 2021 (Eastern Time, Zeitzone US-Ostküste) eingestellt. Ab dem 20. April 2021 (Eastern Time) ist die Website von Yahoo Clever nur noch im reinen Lesemodus verfügbar. Andere Yahoo Produkte oder Dienste oder Ihr Yahoo Account sind von diesen Änderungen nicht betroffen. Auf dieser Hilfeseite finden Sie weitere Informationen zur Einstellung von Yahoo Clever und dazu, wie Sie Ihre Daten herunterladen.

Hello, Using ASP.NET & C#, How do I get a value from a Repeater into a variable in the Code Behind?

Hello, The repeater shows loads of records. At the press of a linkbutton (in each record), I want to get the id of the record which the linkbutton has been clicked on.

I've spend hours trying to do this and I'm still no better off!

I can do this in the frontend using <%# Eval("id")%>. How can I pass this value to the backend? There seems to be no way to do it. When they click on a record, I need to get the id of that record into the codebehind. How can I do it?

Thanks, Ant...

1 Antwort

Relevanz
  • vor 1 Jahrzehnt
    Beste Antwort

    Let's say I have a textbox with an ID of txtAddress and another one txtAllAddress

    For Each i As RepeaterItem In repYourIdForRepeater.Items

    Dim txtAddress As TextBox = i.FindControl("txtAddress")

    txtAddress.Text = txtAllAddress.Text

    Next

    Put that in the button click event. Should get you started. To hard to type code snippets in here.

Haben Sie noch Fragen? Jetzt beantworten lassen.