Alessandro ,
Thank you - I have it working. You have no idea how long I spent on that.
For anyone else with this issue here is the code which which works for me:
Private Sub EducationRepeater_ItemDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles
EducationRepeater.ItemDataBound
Dim MyDeleteButton As Button
If Not IsNothing(e.Item.FindControl("DeleteButton")) Then
MyDeleteButton = CType(e.Item.FindControl("DeleteButton"), Button)
MyDeleteButton.Attributes.Add("OnClick", "confirmDelete()")
End If
End Sub
Sal
--
Sal D'Ambra
Blue Ridge Summit, PA
"Alessandro Zifiglio" <> wrote in
message news

v3Jb.22585$...
> You need to do it in the item databound method of your repeater control :
>
> Private Sub Repeater1_ItemDataBound(ByVal sender As Object, ByVal e As
> System.Web.UI.WebControls.RepeaterItemEventArgs) Handles
> Repeater1.ItemDataBound
> Dim MyDeleteButton As LinkButton
> MyDeleteButton = CType(e.Item.FindControl("Linkbutton4"),
> LinkButton)
> MyDeleteButton.Attributes.Add("OnClick", _
> "return confirm('Are you Sure you want to delete this record?');")
> End Sub
>
> "Sal D'Ambra" <> wrote in message
> news:16ydne1sp6mdLm6iRVn-...
> > Hello All,
> >
> > I have a data repeater control and it has a 'Delete' and 'Edit' button
for
> > each row. I would like to add a pop-up via javascript so when a user
> clicks
> > the 'Delete' button it asks if they are sure. I know I can add an
> attribute
> > for onclick and the name of the script for a button but.... I can't
figure
> > out how to do this for the buttons which are dynamically created. I am
> > looking about in the Repeater.OnItemCreated but frankly I'm stumped.
> Thanks
> > in advance for any help.
> >
> > Sal
> > --
> > Sal D'Ambra
> > Blue Ridge Summit, PA
> >
> >
>
>