如何给 <asp:Image>或<asp:ImageButton>添加onmousemove,onmousedown..事件
   <asp:Image ID="Image_head" runat="server"  ImageUrl="OnlineQQ/head.gif" onmousemove="this.style.border='1';" onmouseout="this.style.border='0';" onmousedown="this.style.border='2';" border="0" />
我是这样写的可是放上去没反映

解决方案 »

  1.   

    是这样写没错,检查下this.style.border='1'的属性是否正确
      

  2.   

    在page_load
    if(!IsPostBack)
    {
      Image_head.Attributes.Add("xx","xx")
    }
      

  3.   

    ImageButton1.Attributes.Add("onmousemove","test()"); 
      

  4.   

    <asp:Image ID="Image_head" runat="server" ImageUrl="http://avatar.profile.csdn.net/2/B/1/2_astraydog.jpg" onmousemove="this.style.borderWidth='1px';" onmouseout="this.style.borderWidth='0px';" onmousedown="this.style.borderWidth='2px';" border="0" />
      

  5.   

    嗯,这个可以的,也可以给他加borderstyle,1px solid 等就可以了