将图像添加到asp:linkbutton?

时间:2012-08-15 22:18:14

标签: c# asp.net controls

如何使用后面的代码将背景图像添加到我的asp:linkbutton?我想在点击链接后更改背景图片? THX

<asp:LinkButton ID="home" runat="server">home</asp:LinkButton>

1 个答案:

答案 0 :(得分:1)

in page_load event when you click and make a postback change image

 if (IsPostBack)
       {                  
                 ImageButton1.ImageUrl = "~/Images/newimage.gif";                           

       }