imagebutton as an href
Posted on 2006-07-13
I have a navigation menu where I've converted my 'a href' tags with rollover images inside them to asp:imagebuttons so they load more efficiently.
However, I'm a little unsure about the best way to add the redirection on each control, they are links to other pages in the site without coding behind. All the controls are in an include file that is loaded with every page on the site so I don't really want to add response.redirect to every control on every page.
So, two questions:
1. Is there a way to redirect to a new page using an imagebutton in the actual aspx page?
2. I don't think I'd want the control to post back to the server would I?
<asp:ImageButton ImageUrl="Images/home.gif" onMouseOver="this.src='Images/home_rvs.gif';" onMouseOut="this.src='Images/home.gif';" runat="server" AlternateText="home" AutoPostBack="false" >
I hope all that makes sense!
thanks in advance