It seems that the ExtenderControlProperties do not support two-way binding. I found a workaround by utilizing a hidden field. Here is how I approached it.
I included this code in the extender:
protected override void OnInit(EventArgs e)
{
HiddenFieldId = ClientID + "_HiddenValue";
Page.ClientScript.RegisterHiddenField(HiddenFieldId, "");
base.OnInit(e);
}
[ExtenderControlProperty]
[DefaultValue("")]
public string HiddenFieldId
{
get { return GetPropertyValue("HiddenFieldId", ""); }
set { SetPropertyValue("HiddenFieldId", value); }
}
public string HiddenFieldValue
{
get { return Page.Request.Form[HiddenFieldId]; }
}
And I added this section in the behaviour:
//In the prototype
get_HiddenFieldId: function() {
return this._hiddenFieldId;
},
set_HiddenFieldId: function(value) {
this._hiddenFieldId = value;
},
//During initialization
this._hiddenFieldId = null;
//Within my method to set the hidden value.
document.getElementById(this._hiddenFieldId).value = valueToSet;