((LinkButton)e.Item.FindControl("my_label_name"))
.Attributes.Add("onclick","javascript:myCustomFunction('"
+ dbValue1 + "','"+dbValue2+"')");
I implemented this code (located in my default.aspx.cs
) and it ran successfully on my local machine but failed to work on the server. No errors were shown, it simply did not execute. If you have any questions or need clarification, please feel free to ask.