How to find control using Find.ById(), Get () by partial control name

2 posts, 0 answers
  1. Behtash Moradi
    Behtash Moradi avatar
    9 posts
    Member since:
    Nov 2009

    Posted 17 Mar 2011 Link to this post

    As .aspx page generates clientid for controls , how we can  find control  by server side id instead of  generated id
    For example
    using Find.ById("txtName") instead of Find.ById("ctrl00_ctrl1_txtName").

    We have developed following utility function for finding control using server side id but  I would like using a Telerik API if exists

           protected T FindByClinetId<T>(string id) where  T:HtmlControl,new()
                return Find.AllControls<T>().Where(x => (x.ID.EndsWith(id))).Single();

  2. Stoich
    Stoich avatar
    1 posts

    Posted 18 Mar 2011 Link to this post

    Hello Behtash,
        it sounds like you need to use a FindExpression. Check out this article:

    Let me know if you require further assistance!

    the Telerik team
Back to Top