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

Problem with $find(=<%RadControl.ClientID %>) function in web user control

1 Answer 92 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jeppe
Top achievements
Rank 1
Jeppe asked on 18 Sep 2008, 08:58 AM
Hi.

I have this problem with calling the $find function (inside a web user controL). I have a situation where a change of dirent radcontrols (specifically a combobox) will set the selected index of a multipage control and other operations. And it works fine client side. But if i want to reflect changes made on serverside (for instance after a page load) I run into problems

The following type of code works when hooking up to the OnClientSelectedIndexChanged event of a RadCombobox:

function

OnClientSelectedIndexChanged(sender, eventArgs) {

var index = sender.get_selectedIndex();

var multipage = $find("<%=RadMultiPageParameterValueKind.ClientID %>");

multipage.set_selectedIndex(index);

}

However if the same type of code is called from OnClientLoad event. The $find function returns null.

NB! In the top Hierachy there is a MasterPage with a RadScriptManager. And this code is inside a Web User Control.


1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 24 Sep 2008, 12:26 PM
Hello Jeppe,

Any JavaScript function named pageLoad() will automatically wireup as an Application.Load handler (basically, the client-side version of Page_Load). For details on the matter please refer to the following ASP.NET article.

Best wishes,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Jeppe
Top achievements
Rank 1
Answers by
Paul
Telerik team
Share this question
or