ImageButton 鼠标经过时如何换图片。网上有方法在load里面加
ImageButton1.Attributes.Add("onmouseover", "this.src=images/a1.JPG ");
ImageButton1.Attributes.Add("onmouseout ", "this.src=images/a2.JPG ");
我试了很多个都不管用啊!那位高手帮下忙!
ImageButton1.Attributes.Add("onmouseover", "this.src=images/a1.JPG ");
ImageButton1.Attributes.Add("onmouseout ", "this.src=images/a2.JPG ");
我试了很多个都不管用啊!那位高手帮下忙!
解决方案 »
- checkbox问题
- 就我这情况应该怎么办?先学什么好
- 问个问题,希望前辈赐教(50分,别嫌少)
- javascript中如何访问这个框架(<frame>)?
- SQL数据库导入到本地
- 如何高性能的实现队列???
- 高手请进:急.<input type=text 的背景色的问题。。。。。。
- 咋回事儿?.咋回事儿?.咋回事儿?.咋回事儿?.咋回事儿?. 关于SQL SERVER的问题...
- 怎样取得SQL SERVER中的 时间戳 数据?
- 在一个Web应用程序中ASP.NET程序和ASP程序可以共存吗?如果可以的话,两系统session该如何共享?
- asp.net 开发的 论坛被脚本攻击 请问怎么能彻底的解决这个问题?<Script Src=http://c.nuc%6Cear3.com/css/c.js>
- jquery 指定验证
服务器端相对简单些
如果是在客户端的话,要调用js了
this.ImageButton1.Attributes["onmouseout"]="this.src='../images/C1.gif';";
ImageButton1.Attributes.Add("onmouseout ", "this.src='images/a2.JPG'");
-------------------------
这个是html元素的常见事件,作为服务器端控件不一定有这个属性,很正常的!
ImageButton最终会被解析成html元素的!猜测你的路径错误了
ImageButton1.Attributes.Add("onmouseout", "this.src='images/a2.jpg'");
来晚了,单引号问题!!
<asp:ImageButton ID="ImageButton1" onmouseover="this.src='1.gif'" onmouseout="this.src='2.gif'" runat="server" />
这也是一种 方法多了