<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BoutonSurvole.aspx.cs" Inherits="BoutonSurvole" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>        
</head>
<body>
    <form id="form1" runat="server">
<asp:ScriptManager runat="server" ID="ScriptManager1">                
    <Scripts>
        <asp:ScriptReference Path="BoutonSurvole.js" />
    </Scripts>                
</asp:ScriptManager>

<script type="text/javascript">
    function log(message) {
        $get("journal").innerHTML += message + "<br>";
    }


    function pageLoad(sender, args) {
        $create(
            ComposantsPersonnalises.BoutonSurvole,
            { 
                text: 'Bouton réactif',
                element: { style: { color: "red" }}
            },

            {
                click: bouton1_click,
                mouseOver: bouton1_mouseOver,
                mouseOut: bouton1_mouseOut
            },
            null,
            $get('bouton1'));
    }

    function bouton1_mouseOver(sender, args) {
        log("bouton survolé");                
        $find('bouton1').set_text("changement de nom");
    }

    function bouton1_mouseOut(sender, args) {
        log("survol terminé");                
    }

    function bouton1_click(sender, args) {
        log("le bouton a été cliqué");
    }
</script>

<button type="button" id="bouton1"></button>
<br />
<div id="journal"></div>
    </form>
</body>
</html>
