Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with onClick attribute

Status
Not open for further replies.

rnooraei

Programmer
Apr 5, 2005
74
CA
Hi
I dont't know why I can not call javascript here. There is not popup message. any help appreciated.

Protected Sub grdContacts_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdContacts.RowDataBound

If e.Row.RowType = DataControlRowType.DataRow Then

Dim deleteButton As LinkButton = CType(e.Row.Cells(0).Controls(2), LinkButton)
deleteButton.Visible = True
deleteButton.Attributes.Add("onClick", "javascript:return confirm('Are you sure you want to delete this record?")

I try to get a confirmatin in my VB code and I am using ASP.NET 2.0

End If

End Sub
 
I believe the attributes for javascript are case sensitive..try "onclick
 
Also, I notice that although you have been a member for over 2 years and asked a few questions on this forum, you haven't marked any of the answers as valuable, and I can only see one or two acknowledgments of other peoples responses. If you are not getting the answers that you need read FAQ222-2244 to see how to ask better questions. If you are getting the answers you need see FAQ222-2244 to see how to acknowledge the answers given.

Paragraph 16 of the FAQ explains about this being a two-way forum, to give guidance on answering other peoples questions, as I also notice that you haven't yet made any posts in other peoples threads.





____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top