<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestingScope.aspx.cs" Inherits="TestingJS.TestingScope" %>

<!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>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <input type="button" value="abc" id="abc" />
    <asp:ScriptManager ID="SM1" runat="server" />
    </form>

    <script type="text/javascript">
    MyObject = function() {
      this._name = "Nazwa domyślna";
    };

    MyObject.prototype = {
      clickEventHandler: function(e, context) {
        alert (this._name + context);
      }
    };

    var a = new MyObject();
    var del = Function.createDelegate(a, a.clickEventHandler);
    var context = {"Date":new Date().getDate(), "x": 319, "y":483};
    var cb = Function.createCallback(del, context);
    $addHandler($get("abc"), "click", cb);
    </script>

</body>
</html>
