views:

43

answers:

1

We are using Telerik radcontrols in our web form and I am trying to solve an annoying problem for a while. According to Telerik, I should be able to find my control from client-side using the following method,

var element = $find('<%= dateSampleDate.RadDatePicker_ClientId %>');

[A little clarification about the statement above: This RadDatePicker is wrapped inside a custom control so I had to expose the ClientId explicitely using a public property; hence the weird looking client id call. Also, the above statement is being called from a javascript function which is attached to a Peter Blum custom validator's CustomEvalFunctionName property and all of my scripts are written at page bottom so that scripts doesn't hamper the loading of DOM.]

Problem is, element is ALWAYS null [checked using FireBug js debugger]. Is that a timing issue?

Suggestions from anyone with experience would be highly appreciated.

+1  A: 

This is probably a timing issue. I think the code is executed before the Ajax components are initialized. You can check this blog post which could be useful.

korchev
Thanks, the Sys.Application.add_load(funcName) finally made it work for me.
MSI