Asp:Image with Link

前端 未结 6 1266
萌比男神i
萌比男神i 2020-12-11 16:25

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 ??

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-11 16:57

    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:

    
       
    
    

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

    
       
    
    

提交回复
热议问题