views:

536

answers:

1

I have some dynamically created inputs which are not server-side controls. I want to relate them to some CalendarExtender and MaskedEditExtender on the clientside. Is there a way to do that?

+1  A: 

Yes I think it may be possible here is how:

On the server side set the BehaviourID attribute of the Ajax control to a known value:

_calendarExtender.BehaviorID = "_behaviour_id"

This allows you then in your javascript to get hold of the underlying CalendarBehaviour object with the $find function :

var calBehaviour = $find('_behaviour_id' );

You can now call the various object functions such as hide() and show() :

calBehaviour.show();

You can get hold of the underlying TextBox input field for the CalendarExtender as follows :

var tbElement = calBehaviour._textbox._element;

I've not tried it but you may thus be able to swap out the original text box for your own client side input control if that's what you want to do or simply manipulate the extender in other ways.

Tom Carter