RadNumericTextBox with put in the id of control "_text"

2 posts, 0 answers
  1. fan
    fan avatar
    5 posts
    Member since:
    Jun 2010

    Posted 19 Feb 2012 Link to this post

    I'm using asp.net ajax tool and I create dynamically 3 RadNumeric TextBoxes with names  RadNumTxt1, RadNumTxt2, RadNumTxt3. 
    I create the Text Boxes as follow:
                for (int i = 1; i <= 3; i++){
                        RadNumericTextBox RadNumTxt = new RadNumericTextBox();
                        RadNumTxt .ID = "RadNumTxt" + i;
                        RadNumTxt.AllowOutOfRangeAutoCorrect = true;
                        RadNumTxt.Display = true;
                        RadNumTxt.Enabled = true;
                        RadNumTxt.Visible = true;
                        RadNumTxt.ClientIDMode = System.Web.UI.ClientIDMode.Static;
    After rendering the page in browser the ids of the  Numeric Texts Boxes have been changed into RadNumTxt1_text, RadNumTxt2_text, RadNumTxt3_text. 

    When I try to change the value of these inputs with javascript in client by using the new ids of the inputs like "RadNumTxt1_text" I change them, but when click on them the values that I have change disappeared.  What I am doing wrong?

  2. Veli
    Veli avatar
    2002 posts

    Posted 22 Feb 2012 Link to this post

    Hi fan,

    Changing the ID of the HTML elements in the controls is not supported. The control requires specific element IDs to be able to manipulate successfully manipulate the DOM. By the way, can you, please, verify the version of RadControls you are using? In version Q1 2012, we've introduced the so-called "single input rendering", where your visible textbox no longer has "_text" appended to its ID.

    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top