I am rather new to ASP and would like some help on how to create an ImageButton where I can hide where I am redirecting my customers to. I know how to do this with the LinkButton. I've got some code written where in my default.aspx I have defined the LinkButton and in my aspx.vb file I have this: Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton2.Click Response.Redirect("http://blah blah blah.com") End Sub How do I get the same effect with an image button? Thank you so much to all who can help me! It is an urgent matter... thanks again!
Sub ImageButton_Click(sender As Object, e As ImageClickEventArgs) // blah End Sub Code (markup): dont forget your handles part.
Image Button doesn't have Handles part, instead it has OnClick attribute. View example below : i.e. you have code below in your .aspx : <asp:ImageButton id="btnUpload" onclick="btnUpload_Click" runat="server" ImageUrl="~/Images/upload.png" ImageAlign="AbsBottom" __designer:wfdid="w33"></asp:ImageButton> so, inside .vb you should have : Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) ' Save file here End Sub By double clicking an imagebutton on designer mode, you should have it automatically. Hope this help..
it will show you automatically on default.aspx while you doubleclick on that image button you just have to insert a coding of your effect which you want to apply.