Home > DeveloperSection > Forums > ImageButton With Mouse Event Handlers Considered Not Well Formed
Samuel Fernandes
Samuel Fernandes

Total Post:154

Points:1082
Posted on    August-26-2014 2:41 AM

 ASP.Net
Ratings:


 1 Reply(s)
 685  View(s)
Rate this:

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.



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    August-26-2014 5:10 AM

Hi samuel, 
try this:

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


Don't want to miss updates? Please click the below button!

Follow MindStick