Il primo modo che mi è venuto in mente:
Sfrutto l'evento ItemDataBound
codice:
Protected Sub Repeater1_ItemDataBound(sender As Object, e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles Repeater1.ItemDataBound
Select Case e.Item.ItemType
Case ListItemType.Item, ListItemType.AlternatingItem
Dim cmbSconto As DropDownList = TryCast(e.Item.FindControl("cmbSconto"), DropDownList)
If cmbSconto IsNot Nothing Then
Dim lblPrezzoScontato As Label = TryCast(e.Item.FindControl("lblPrezzoScontato"), Label)
If lblPrezzoScontato IsNot Nothing Then
cmbSconto.Attributes.Add("onchange", String.Format("cambioSconto(this, document.getElementById(""{0}""));", lblPrezzoScontato.ClientID))
End If
End If
debug = True
End Select
e la funzione javascript
codice:
function cambioSconto(v, v1)
{
//alert(v.value);
v1.innerHTML = v.value;
}