<asp:Button ID="btnSearch" runat="server" Style="z-index: 106; left: 480px; position: absolute;
            top: 24px" Text="搜索" Width="72px" onmouseover="this.style.height='80px';this.style.color='red';this.style.backgroundColor='yellow';this.style.fontWeight='bold'"/>
警告:onmouseover不是Button有效属性。该如何解决?

解决方案 »

  1.   

    在cs里写btnSearch.Attributes.Add("onmouseover","this.style.height='80px';this.style.color='red';this.style.backgroundColor='yellow';this.style.fontWeight='bold';");
      

  2.   

    INPUT style="Z-INDEX: 104; LEFT: 328px; POSITION: absolute; TOP: 360px" type="button"
    value="Button"id="Button2"onmouseover="this.style.height='80px';this.style.color='red';this.style.backgroundColor='yellow';this.style.fontWeight='bold'">
      

  3.   

    在后台为此添加属性:
    ----------如在Page_load中加-----------------
    Page_Load()
    {
    btnSearch.Attributes.Add("onmouseover","this.style.height='80px';this.style.color='red';this.style.backgroundColor='yellow';this.style.fontWeight='bold'");
    }
      

  4.   

    <asp:Button ID="btnSearch" runat="server" Style="z-index: 106; left: 480px; position: absolute;
                top: 24px" Text="搜索" Width="72px" onmouseover="this.style.height='80px';this.style.color='red';this.style.backgroundColor='yellow';this.style.fontWeight='bold'"/>-------------------------------------------------------------------------------
    定义个CSS
    .over{height:80px;color:red;back.....}<asp:Button ID="btnSearch" runat="server" Style="z-index: 106; left: 480px; position: absolute;
                top: 24px" Text="搜索" Width="72px" onmouseover="this.className='over'"/>