I am trying to create a custom Ajax control consisting of one radcombo and about 6 text box controls. I want to populate the text boxes with details of the selected item in the rad combo. I have this working with a basic html drop down, the change event on the drop down fires off which access a web service w/ json serialization and it's very simple to update the text boxes. I've declared my control like so:
public class GlnComboPartyPicker : DataBoundControl, IPostBackDataHandler, IScriptControl, INamingContainer//, IPostBackDataHandler//, IDataSource
I later implement the GetScriptDescriptors method:
IEnumerable<ScriptDescriptor> IScriptControl.GetScriptDescriptors() {
EnsureChildControls();
ScriptControlDescriptor descriptor = new ScriptControlDescriptor("MyControlNS.MyControl", this.ClientID);
The control renders, the radcompo is populated and scrolls nicely etc.. BUT, normally I would add a handler to a basic html dropdown in the javascript that initializes the client class:
MyControlNS.MyControl.prototype = {
initialize: function() {
GLNPartyPickerControl.PartyPicker.callBaseMethod(this, 'initialize');
$addHandlers(this._partiesDDLElement, { "change": this._selectedPartyChangedHandler }, this);
But since the radcombo isn't a html dom object, I can't attach the event this way and every other thing I've tried has failed. How do I tell the radcombo in my custom control, on the client, what to execute when the radcombo's selected item changes? I don't seem to be able to get a reference to the client side radcombo object. Remember this is a custom control so I need to always reference a function of this, my, control. Thanks !
public class GlnComboPartyPicker : DataBoundControl, IPostBackDataHandler, IScriptControl, INamingContainer//, IPostBackDataHandler//, IDataSource
I later implement the GetScriptDescriptors method:
IEnumerable<ScriptDescriptor> IScriptControl.GetScriptDescriptors() {
EnsureChildControls();
ScriptControlDescriptor descriptor = new ScriptControlDescriptor("MyControlNS.MyControl", this.ClientID);
The control renders, the radcompo is populated and scrolls nicely etc.. BUT, normally I would add a handler to a basic html dropdown in the javascript that initializes the client class:
MyControlNS.MyControl.prototype = {
initialize: function() {
GLNPartyPickerControl.PartyPicker.callBaseMethod(this, 'initialize');
$addHandlers(this._partiesDDLElement, { "change": this._selectedPartyChangedHandler }, this);
But since the radcombo isn't a html dom object, I can't attach the event this way and every other thing I've tried has failed. How do I tell the radcombo in my custom control, on the client, what to execute when the radcombo's selected item changes? I don't seem to be able to get a reference to the client side radcombo object. Remember this is a custom control so I need to always reference a function of this, my, control. Thanks !