Hi All,
Thanks..
I got the solution. I used the following code
Protected Sub dgDesignation_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles dgDesignation.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
For Each ctl As Control In e.Row.Cells(1).Controls
If TypeOf ctl Is LinkButton Then
Dim link As LinkButton = CType(ctl, LinkButton)
If link.CommandName = "Update" Then
link.OnClientClick = "return ValidateUpdate('" + e.Row.Cells(0).Controls(0).ClientID + "');"
End If
End If
Next
Dim l As LinkButton
l = CType(e.Row.FindControl("lnkDelete"), LinkButton)
l.Attributes.Add("onclick", "javascript:return confirm('Are you sure you want to delete this record?')")
End If
End Sub
Ragards,
Anurag
|