这样?
if(Button1.ImageUrl == "Images/1.gif")
{
   Button1.ImageUrl = "Images/2.gif";
}
else if (Button1.ImageUrl = "Images/2.gif";)
{
  Button1.ImageUrl = "Images/1.gif";
}

解决方案 »

  1.   

    指定js代码用来改变图片(这里使用的不是ImageButton而是Button)
    btn.Attributes.Add("class","button");
    btn.Attributes.Add("onmouseover","this.className='buttonover'");
    btn.Attributes.Add("onmouseout","this.className='buttonout'");
    CSS里面对应的部分:
    .button{width:100; height:20;BACKGROUND: url("/AppBaGang/images/button/button_v3.gif") repeat-y; border:0 solid silver; COLOR: #ffffff; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; LINE-HEIGHT: normal}.buttonover{width:100; height:20;BACKGROUND: url("/AppBaGang/images/button/button_v4.gif") repeat-y; border:0 solid silver; COLOR: #ffffff; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; LINE-HEIGHT: normal}.buttonout{width:100; height:20;BACKGROUND: url("/AppBaGang/images/button/button_v3.gif") repeat-y; border:0 solid silver; COLOR: #ffffff; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; LINE-HEIGHT: normal}上面可以达到同样的效果!
      

  2.   

    onMouseOut  图1
    onMouseOver 图2要这样的效果
      

  3.   

    用javascrpt变换图片.http://zjchome.diy.zjip.com/page/teji/teji35.htm
      

  4.   

    可以参考下面的:
    btnNew.Attributes.Add("onmouseover", "this.src='../Imgs/new_over.gif'");
    btnNew.Attributes.Add("onmouseout", "this.src='../Imgs/new_out.gif'");
      

  5.   

    有没有Onmouseover函数?如何用!