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>
我认为所有鼠标事件属性都是合法的,所以我不知道它在抱怨什么。
答案 0 :(得分:2)
如果你从代码中逐字复制它,你就会错过一个等号:
onmousedown事件 “this.src = '图像/ add_plus_3.gif'”
答案 1 :(得分:1)
<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()" />