1: // README
2: //
3: // There are two steps to adding a property:
4: //
5: // 1. Create a member variable to store your property
6: // 2. Add the get_ and set_ accessors for your property
7: //
8: // Remember that both are case sensitive!
9:
10:
11: /// <reference name="MicrosoftAjaxTimer.debug.js" />
12: /// <reference name="MicrosoftAjaxWebForms.debug.js" />
13: /// <reference name="AjaxControlToolkit.ExtenderBase.BaseScripts.js" assembly="AjaxControlToolkit" />
14:
15:
16: Type.registerNamespace('AJAXControls.ChangeConfirmer'); 17:
18: AJAXControls.ChangeConfirmer.ChangeConfirmerBehavior = function(element) { 19: AJAXControls.ChangeConfirmer.ChangeConfirmerBehavior.initializeBase(this, [element]);
20:
21: // TODO : (Step 1) Add your property variables here
22: this._DataChanged=false;
23: this._Saving=false;
24: this._SubmitButtonValue=null;
25: }
26: AJAXControls.ChangeConfirmer.ChangeConfirmerBehavior.prototype = { 27: initialize : function() { 28: AJAXControls.ChangeConfirmer.ChangeConfirmerBehavior.callBaseMethod(this, 'initialize');
29:
30: // TODO: Add your initalization code here
31: Sys.UI.DomEvent.addHandler(this.get_element(), 'keyup',Function.createDelegate(this, this._onchange));
32: Sys.UI.DomEvent.addHandler($get(this._SubmitButtonValue), 'click',Function.createDelegate(this, this._onclick));
33: Sys.UI.DomEvent.addHandler(window, 'beforeunload',Function.createDelegate(this, this._onunload));
34: },
35:
36: _onchange:function(){ 37: this._DataChanged=true;
38: },
39:
40: _onclick:function(){ 41: this._Saving=true;
42: },
43:
44: _onunload:function(event){ 45: if(!this._Saving&&this._DataChanged)
46: { 47: event.preventDefault();
48: }
49: },
50:
51: dispose : function() { 52: // TODO: Add your cleanup code here
53:
54: AJAXControls.ChangeConfirmer.ChangeConfirmerBehavior.callBaseMethod(this, 'dispose');
55: },
56:
57: // TODO: (Step 2) Add your property accessors here
58: get_SubmitButtonID : function() { 59: return this._SubmitButtonIDValue;
60: },
61:
62: set_SubmitButtonID : function(value) { 63: this._SubmitButtonValue = value;
64: }
65: }
66: AJAXControls.ChangeConfirmer.ChangeConfirmerBehavior.registerClass('AJAXControls.ChangeConfirmer.ChangeConfirmerBehavior', AjaxControlToolkit.BehaviorBase);