problem with telerik Q1 2012

3 posts, 1 answers
  1. Jiju
    Jiju avatar
    57 posts
    Member since:
    Jul 2011

    Posted 25 Feb 2012 Link to this post

    I have recently updated telerik from Q3 2009 to Q1 2012, and i am facing some problems.
    I have used for example document.getElementById('ctl00_PlaceHolderMain__rdtxtFirstName_text') to get the value of _rdtxtFirstName from client side.
    but now when changed to Q1 2012, the id is showing ctl00_PlaceHolderMain__rdtxtFirstName insted of ctl00_PlaceHolderMain__rdtxtFirstName_text.
    and i have used a css file to set the width of rad textbox and other controls, and now the controls' width is not showing as mentioned in css class.
    How can i fix these issues?
    21S  QUADRATUS avatar
    1 posts
    Member since:
    Jun 2009

    Posted 28 Feb 2012 Link to this post

    My problems seems to be the same than yours.
    Do you have any answer(Telerik; user?) a this time to fix this?

  3. Answer
    Antonio Stoilkov
    Antonio Stoilkov avatar
    530 posts

    Posted 29 Feb 2012 Link to this post


    The experienced issues are expected because the client id's of the controls are not static and could change. When implementing such scenario the supported and recommended way is to use RadScriptBlock and reference the controls as it is shown in the example below. Note that this approach also overcome issues when changes to the layout are made.
    <telerik:RadScriptBlock runat="server">
        <script type="text/javascript">
            var textBoxFirstElement = document.getElementById("<%= rdtxtFirstName.ClientID %>");

    All the best,
    Antonio Stoilkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top