Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I would like to place an image in my application. when I click on it I want to move to another page. In general my asp:image to work as link Is that possible ??

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
167 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can use an ImageButton with a server side click event:

Response.Redirect("SecondPage.aspx");

Or alternatively, you could wrap a Hyperlink control around the Image control:

<asp:hyperlink id="link" runat="server">
   <asp:image id="img" runat="server" imageurl="..." />
</asp:hyperlink>

Or just use a HTML anchor tag if you don't need the link to be dynamic:

<a href="..">
   <asp:image id="img" runat="server" imageurl="..." />
</a>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...