Hi Below is my codeThe first 3 lines are run in the DataList1_ItemDataBound event and they call the sub below, of which there is the opening line.My question is if I change the signature from System.Web.UI.WebControls.Image toSystem.Web.UI.WebControls.ImageButton this still works and vice versa so it'll work in the found control is either a imagebutton or image.1. Can anyone explain why it does work fine either way?2. The ByVal ImgProfile As System.Web.UI.WebControls.Image, should this be ByRef, aren't controls passed by reference rather than value?Or I am getting this mixed up. The reason why I say this is I can modify the image control that's passed in and if it was passed by value then I shouldn't be able to modify the control, or should I?Dim Image1 As ImageImage1 = CType(e.Item.FindControl("ImageButton1"), Image)DisplayImage(UserID, Image1)Protected Sub DisplayImage(ByVal pUserID As String, ByVal pImgProfile As System.Web.UI.WebControls.Image)thanks.
View Complete Post