This is a migrated thread and some comments may be shown as answers.

javascript $find("<%= RadGrid1.ClientID %>") returns null on the webserver

5 Answers 728 Views
Grid
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 08 Oct 2014, 07:37 PM
Hi,

When testing my code on my development box, I am attempting to find a radgrid in javascript (on the client) using the command:

$find("<%= RadGrid1.ClientID %>")


This returns an object and I have no problems.

When I deploy my code to our web server, this returns a null.  My question is whether the web server needs to have a Telerik license installed or can the binaries be deployed and the code should work.

The current deployed binaries are:
Telerik.Web.UI.XML
Telerik.Web.Device.Detection.xml
Telerik.Web.Design.dll
Telerik.Web.Device.Detection.dll
Telerik.Web.UI.dll
Telerik.Web.UI.Skins.dll

Thanks,

5 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 13 Oct 2014, 02:35 PM
Hi,

The $find() method is actually a shortcut for the findComponent() method. It should work the same when testing the application locally and after hosting it.

With this said, it would be hard to pinpoint what exactly is causing the issue. Check the browser console and see if there are any JavaScript errors when opening the page. If there is such error the client-side scripts would not work correctly.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
L
Top achievements
Rank 1
answered on 16 Oct 2014, 01:49 PM
Thanks for you reply. It did point me to the right direction.

For some reason, the RadScriptManager does not work on my deployment server, I received a "Sys.Extended" not defined error. I end up having to replace it with Ajax script manager:

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat=server></ajaxToolkit:ToolkitScriptManager>    

After using this, it worked. However, I am a little concerned if this will create any problem down the road. What do you think?




0
Viktor Tachev
Telerik team
answered on 21 Oct 2014, 08:52 AM
Hello,

I am glad to hear that the issue was resolved.

Note that the Ajax Control Toolkit works only with ToolkitScriptManager. This change was announced earlier this year. You can read more on it in this thread.

With this said, currently the controls should work as expected with the ToolkitScriptManager. However, we cannot guarantee that a future change in the ToolkitScriptManager would not affect the work of Telerik controls.

In order to use both suites I recommend thoroughly testing the application before deploying it.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Andy Green
Top achievements
Rank 2
answered on 24 Apr 2015, 01:42 PM

Hi

I'm having the exact same issue here, in that $find("controlName") returns a null, I'm using Clientid = static.

Is there any more info out there?

Andy

0
Viktor Tachev
Telerik team
answered on 28 Apr 2015, 09:55 AM
Hello Andy,

Note that ClientIDMode for the controls should be set to AutoID in order for the controls to work as expected. For additional information check the following article.

Make sure that the ClientIDMode property is removed or is set to AutoID and see how the behavior changes.

Also when getting reference to the client-side object of the controls make sure that you use their ClientID.

var grid = $find("<%= RadGrid1.ClientID %>");


Regards,
Viktor Tachev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Grid
Asked by
L
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
L
Top achievements
Rank 1
Andy Green
Top achievements
Rank 2
Share this question
or