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

How to obtain the input control from a usercontrol $find("%= loginname.ClientID %>") does not work

2 Answers 91 Views
Input
This is a migrated thread and some comments may be shown as answers.
Joao Araujo
Top achievements
Rank 1
Joao Araujo asked on 09 Sep 2009, 08:31 PM
Hello,

      I have several input text on a form . All of them I can use inside a
      javascript thru the $find function.  Unfortunately, controls that
      I have inside a usercontrol are not accessible .

      How can I access this user control inserted on my form ?

      Here is what I have.

      <%@ Register src="../item.ascx" tagname="item" tagprefix="user" %>

      <user:item id="useritem" runat=server  />

      <telerik:radtextbox id="phone" runat="server" />

      <script type="text/javascript">
          var phone = $find("%= phone.ClientID");  //..... this one works
          var user   =  $find("%= user.ClientID");  // ... does not work user is inside the useritem control.

     </script>

      I am using version 2009.2.831  (the last update)

      Thanks
Joao, 

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 10 Sep 2009, 06:00 AM
Hi Joao,

User controls does not render any HTML element and does not have any client-side ASP.NET AJAX component - that is why you cannot use $find() and/or $get().

Sincerely yours,
Vlad
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.
0
Joao Araujo
Top achievements
Rank 1
answered on 10 Sep 2009, 03:55 PM
Hello,

    Do you know a way to capture this control id at client processing time?

    I know I can use UserItem.FindControl at the server side.  I really wish I can do this at
    the client. I Know we have the $telerik lib, but I could not put the findControl method to work.
    I am probably doing something wrong.
   

    Thanks,


Joao,
Tags
Input
Asked by
Joao Araujo
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Joao Araujo
Top achievements
Rank 1
Share this question
or