<ASP:IMAGEBUTTON onmouseover="this.src='showimga.aspx?id=1'" onmouseout="this.src='showimage.aspx?id=2'" id="ImageButton2" runat="server"></ASP:IMAGEBUTTON>showimage.aspx中根据id 从数据库中显示图片

解决方案 »

  1.   

    我的图片不是在数据库中的,我是这样写的:
    private void Page_Load(object sender, System.EventArgs e)
    {
    ImageButton1.Attributes.Add("onmouseover","this.src=images/a1.JPG'");
    ImageButton1.Attributes.Add("onmouseout","this.src=images/a2.JPG'");
    ImageButton2.Attributes.Add("onmouseover","this.src=images/b1.JPG'");
    ImageButton2.Attributes.Add("onmouseout","this.src=images/b2.JPG'");
    }
    但是这样以后,当我鼠标同时离开2个控件的时候同时显示图片的灰色状态,我想要当鼠标同时离开时候各自控件恢复他的启示图片
      

  2.   

    我现在实现了onmouseover 时图片的来回转换
    但是下面的信息我不知道怎么转化