") returns null on the webserver" />

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

6 posts, 0 answers
  1. L
    L avatar
    2 posts
    Member since:
    Jul 2013

    Posted 08 Oct 2014 Link to this post

    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,
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2372 posts

    Posted 13 Oct 2014 Link to this post

    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.

     
  3. L
    L avatar
    2 posts
    Member since:
    Jul 2013

    Posted 16 Oct 2014 in reply to Viktor Tachev Link to this post

    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?




  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2372 posts

    Posted 21 Oct 2014 Link to this post

    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.

     
  5. Andy Green
    Andy Green avatar
    376 posts
    Member since:
    Aug 2008

    Posted 24 Apr 2015 in reply to Viktor Tachev Link to this post

    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

  6. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2372 posts

    Posted 28 Apr 2015 Link to this post

    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.

     
Back to Top