简体   繁体   English

带有鼠标事件处理程序的ImageButton被认为格式不正确

[英]ImageButton With Mouse Event Handlers Considered Not Well Formed

ASP.NET says that the following ImageButton server tag is not well formed: ASP.NET表示以下ImageButton服务器标记的格式不正确:

<asp:TableCell VerticalAlign="Top">
    <asp:ImageButton runat="server" ID="imgAdd" src="Images/add_plus_1.gif"
        onmouseout="this.src='Images/add_plus_1.gif'"
        onmouseover="this.src='Images/add_plus_2.gif'"
        onmousedown"this.src='Images/add_plus_3.gif'"
        CauseValidation="false" style="cursor: pointer"
        OnClientClick="Javascript:SL_AddBuilding()" />
</asp:TableCell>

I think all the mouse event attributes are legit, so I don't know what it's complaining about. 我认为所有鼠标事件属性都是合法的,因此我不知道它在抱怨什么。

If you copied it verbatim from your code you are missing an equal sign: 如果您从代码中逐字复制了它,则会丢失等号:

onmousedown"this.src='Images/add_plus_3.gif'" onmousedown“ this.src ='Images / add_plus_3.gif'”

    <asp:ImageButton runat="server" ID="imgAdd" src="Images/add_plus_1.gif"
    onmouseout="this.src='Images/add_plus_1.gif'"
    onmouseover="this.src='Images/add_plus_2.gif'"
    onmousedown="this.src='Images/add_plus_3.gif'"
    CauseValidation="false" style="cursor: pointer"
    OnClientClick="Javascript:SL_AddBuilding()" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM