Using $find issue in MVC

Thread is closed for posting
2 posts, 0 answers
  1. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 17 Dec 2009 Link to this post

    Hello,

    Using the RadControl helper to create a date picker.  I'm also using script to do this:

    var comp = $find("<%= StartDate.ClientID %>");

    Similar to what you would do in ASP.NET web forms.  But I get an error.  So I took it out and inspected the markup, and I couldn't find a StartDate element, so I don't know if that is also contributing to the error.

    Any ideas for handling this?

    Thanks.
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 23 Dec 2009 Link to this post

    Hi Brian Mains,

    To find the client object of specified radcontrol you will need to pass the id of the component to the $find method. In the case when you are using Html.RadControl<T>() method you set id of the control into Func. The defined id is the one you should use when you are looking for the client object.

    I have attached a test project which shows how to achieve your goal.

    Kind regards,
    Georgi Krustev
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top