请教各位高手 imagebutton控件如何引入脚本  ???谢谢!!

解决方案 »

  1.   

    <asp:ImageButton OnClientClick="js脚本"...
      

  2.   

    ibn. Attributes.Add("onmouseover", "this.style.cursor='hand';");
    ibn.Attributes.Add("onclick", "onresu('"+str+"')");
      

  3.   

    显示或隐藏的元素的display不一定都是block,也可能是inline、table等情况,我这个都考虑了:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
    <title></title>
    <script>
    var status;
    function abc(XelementId)
    {
    var element = document.getElementById('text1');
    if (element.style.display == "none")
    element.style.display = status;
    else
    {
    status = element.style.display;
    element.style.display = "none";
    }
    }
    </script>
    </head>
    <body>
    <form id="form1" runat="server">
    <div id="div1" runat="server">
    <input type="text" id="text1" />
    <asp:ImageButton ID="ImageButton1" ImageUrl="~/abc.jpg" runat="server" OnClientClick="abc('text1');return false;" />
    </div>
    </form>
    </body>
    </html>
      

  4.   

    前台 OnClientClick或者 后台
    imagebuttonID.Attributes.Add("onmouseover", "this.style.cursor='hand';");