2011-01-20 4 views
0

ASP.NET은 다음하여 ImageButton 서버 태그가 잘 형성되지 않는 것을 말한다 형성되지 고려 :하여 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

작동하는 동안은 onMouseDown

을, 당신은 추가해야 이미지 버튼의 속성을 통해 onmouseout, onmouseover, onmousedown. – ScottE

답변

3

당신이 등호 누락 코드에서이 그대로 복사 한 경우 : "this.src = '이미지/add_plus_3.gif'"

+0

감사합니다, Eagle Eye. 어리석은 통역사가 왜 내게이 말을하지 못했을까요? – Buggieboy

+0

onmousedown = "this.src = 'Images/add_plus_3.gif'" '누락 된 동등 함 - DASH가 맞습니다. –

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