开发者

ImageButton With Mouse Event Handlers Considered Not Well Formed

ASP.NET says that the following ImageButton server tag is not well formed:

<asp:TableCell VerticalAlign="Top">
    <asp:ImageButton runat="server" ID="imgAdd" src="Images/add_plus_1.gif"
        onmouseout="this.src='Images/add_plus_1.gif'"
        onmouseo开发者_开发技巧ver="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'"


    <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()" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜