Inside one of these user controls (SearchName), is a RadTextBox (NameTextBox). If I reference that user control/textbox from the content page via,
nameTextBox = $find(
'<%= SearchName.FindControl("NameTextBox").ClientID %>');
...everything is fine. I can even add a "add_keyPress" method to that textbox variable.
The problem arises when I try to move this textbox reference from the content page to within the user control via,
nameTextBox = $('#NameTextBox');
...and leave the variable itself (nameTextBox), defined in the content page as a global variable (I need to do things with it there). I'm trying to encapsulate as much as possible within the user control.
For some reason, after the user contol is loaded...the "nameTextBox" variable within the content page no longer has any of the Telerik methods defined within it, e.g. add_keyPress. I get an "Object doesn't support this property or method" error when I try to add this method to the textbox variable, e.g.
nameTextBox.add_keyPress(nameTextBox_KeyPress);
It almost seems like this textbox object is the ASP textbox control...and not the RAD textbox control??? Any help would be appreciated.