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

problem with telerik Q1 2012

2 Answers 113 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jiju
Top achievements
Rank 1
Jiju asked on 25 Feb 2012, 07:20 AM
Hi,
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?

2 Answers, 1 is accepted

Sort by
0
21S QUADRATUS
Top achievements
Rank 2
answered on 28 Feb 2012, 04:54 PM
Hi,
My problems seems to be the same than yours.
Do you have any answer(Telerik; user?) a this time to fix this?
Regards,

Daniel
0
Accepted
Antonio Stoilkov
Telerik team
answered on 29 Feb 2012, 12:25 PM
Hi,

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 %>");
    </script>
</telerik:RadScriptBlock>

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.
Tags
General Discussions
Asked by
Jiju
Top achievements
Rank 1
Answers by
21S QUADRATUS
Top achievements
Rank 2
Antonio Stoilkov
Telerik team
Share this question
or