带有鼠标事件处理程序的ImageButton被认为没有很好地形成 [英] ImageButton With Mouse Event Handlers Considered Not Well Formed
本文介绍了带有鼠标事件处理程序的ImageButton被认为没有很好地形成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
ASP.NET表示以下ImageButton服务器标记格式不正确:
< asp:TableCell VerticalAlign =顶部>
onmouseout =this.src ='images / add_plus_1.gif'
onmouseover =this.src ='Images / add_plus_2.gif'
onmousedownthis.src ='Images / add_plus_3.gif'
CauseValidation =falsestyle =cursor:pointer
OnClientClick =Javascript:SL_AddBuilding()/>
< / asp:TableCell>
我认为所有的鼠标事件属性都是合法的,所以我不知道它在抱怨什么。
解决方案
如果您逐字地从代码中复制了它,那么您将缺少一个等号:
onmousedownthis.src ='图片/ add_plus_3.gif'
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'"
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'"
这篇关于带有鼠标事件处理程序的ImageButton被认为没有很好地形成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文