Can I define my own Client IDs when I place controls on a page?

Thread is closed for posting
2 posts, 0 answers
  1. Klaus
    Klaus avatar
    5 posts
    Member since:
    Apr 2009

    Posted 12 Oct 2009 Link to this post

    I recently purchased the AJAX RADControls since read that it is one of the best AJAX libraries available.

    I am trying to move my web apps into AJAX. I use server controls only for the initial page rendering of the DOM elements and then make web-service calls (using PageMethods or WCF) to populate or manipulate any grids, forms or data that exist in the page.

    I added some of the Telerik controls to replace plain HTML tags (such as drop-down lists, inputs, etc.) but it is difficult it is to find these controls in the DOM in order to manipulate them (especially when they are embedded within other ASP.Net server controls).

    To find a Telerik Control I have to resort to such calls as:
    var combo = $find("<%= RadComboBox1.ClientID %>");
    var item = combo.findItemByText(text);

    (By the way, this code above will NOT run when you place your script code in a separate JS file which is a best practice that I prefer to follow.)

    I am trying to use these controls for 100% strictly data access via AJAX.
    I don't need the ASP.Net engine to assign them an ID in the DOM, I want to control this ID myself so that I can more easily access them from my scripts.

    Can I define my own Client IDs when I place controls on a page declaratively or programmatically?

    Can I assign the Client IDs of the RADControls when using ASP.NET MVC?

    Let me know if this level of control is possible with RADControls.

    Klaus Barkhausen

  2. Georgi Krustev
    Georgi Krustev avatar
    3688 posts

    Posted 15 Oct 2009 Link to this post

    Hello Klaus,

    Unfortunately the required functionality is not attainable.
    ASP.NET 4.0 will allow to configure the client IDs of the controls.

    All the best,
    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. DevCraft R3 2016 release webinar banner
Back to Top