开发者

Telerik RadControl(ASP.NET AJAX): Can't find control using suggested method

开发者 https://www.devze.com 2023-01-17 18:35 出处:网络
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 s开发者_运维技巧hould be able to find my control from client-side usi

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 s开发者_运维技巧hould 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消