Problem with find$

4 posts, 0 answers
  1. Michael Constantine
    Michael Constantine avatar
    18 posts
    Member since:
    Jan 2006

    Posted 30 Sep 2009 Link to this post

    i know this is a silly question, but i have a splitter on a page and am trying to call a javascript function to scroll the splitter to the bottom on page load.

     

    var splitter = $find("<%= RadSplitter1.ClientID %>");

    always says splitter is null or not an an object.

    What am i missing??

    Thanks!

     

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 01 Oct 2009 Link to this post

    Hi Michael,

    I tried the code and I am able to get reference to RadSplitter clientside object using above code. Could you provide the version of RadControl that you are using?

    Here is the documentation on how to get the client side object in RadSplitter for ASP.NET version: Basics
    And here is the documentation on how to get the client side object in RadSplitter for ASP.NET AJAX version: Client-Side Basics

    Are you placed the RadSplitter in any UserControl?

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Michael Constantine
    Michael Constantine avatar
    18 posts
    Member since:
    Jan 2006

    Posted 01 Oct 2009 Link to this post

    Product version is 2009.02.0826.35

    I do not have the splitter in a user control.  A simple page with a splitter and a script.

     

    <script type="text/javascript">

     

     

    var splitter = $find("<%= RadSplitter1.ClientID %>");

     

     

    alert(splitter);

     

    </script>

    always returns null

     

  5. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 02 Oct 2009 Link to this post

    Hi Michael Constantine,
    The client objects for the RadControls are created on the Sys.Application.init event. That is why, in case you want to get a reference to a RadControl client object, you can do this after the init event. For example:
    <script type="text/javascript"
    function pageLoad() 
        var splitter = $find("<%= RadSplitter1.ClientID %>"); 
        alert(splitter); 
    </script> 

    Greetings,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top