Disabled asp button
        Posted  
        
            by Geoorg
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Geoorg
        
        
        
        Published on 2010-06-07T12:57:01Z
        Indexed on 
            2010/06/07
            13:02 UTC
        
        
        Read the original article
        Hit count: 257
        
Hi, i have asp button like this:
<asp:Button ID="ImportToDB" runat="server" OnClick="ImportToDB_Click" />
And i need to call a javascript function when mouseover on this button. So i have in page_load():
ImportToDB.Attributes.Add("onmouseover","javascript:OnButtonMove(" + ImportToDB.ClientID + ")");
javascript function:
<script language="JavaScript" type="text/javascript">
 function OnButtonMove(id) {
         //something
 }
</script>
Everithing work fine only if button is enabled. but when i disable button, this javascript function will never fire.
what i am trying to do: I have button and when is something wrong i just disable it. And when user mouseover this(disable) button, I show him DIV with a message.
Can someone tell me why i cannot call this JS function while button is disabled?
© Stack Overflow or respective owner