Interesting find at work today. One of my developers had two asp:image controls positioned to the right and left of a button. The developer wanted on the click of an image to call the button postback. I had no idea that the GetPostBackEventReference(control) even existed until Brendan pointed me to it (thanks buddy).
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
imgLeft.Attributes.Add("onclick", Page.GetPostBackEventReference(myButton))
imgRight.Attributes.Add("onclick", Page.GetPostBackEventReference(myButton))
End If
End Sub
Is this "Coding Better"? Hell if I know, it seems to work though.