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

Multiple ComboxBox in usercontrol

6 Answers 98 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dominic
Top achievements
Rank 2
Dominic asked on 22 Sep 2008, 01:37 PM
Hi

I've tried to reproduce this demo http://demos.telerik.com/ASPNET/Prometheus/ComboBox/Examples/Functionality/MultipleComboBoxes/DefaultCS.aspx in a user control that loads others user controls depending on the user's choice. The problem is that i always get a 'undefined' error message from the javascript function call. I've put the javascript function in the usercontrol where i have to use it, is that correct or i have to put it in the page itself ??

Thanks in advance for your helps.

6 Answers, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 22 Sep 2008, 04:09 PM
Hey Dominic,

Are you setting your test up as they have it in the example?

Form
.ScriptManager
..div
...Content
../div
.Javascript
/Form

?

I would think if you stick to this format you should be fine...  This keeps everything in the right place and should have the JS accessible to the Comboboxes.   Can you paste your code and maybe we can see where the problem is?

-Serrin
0
Simon
Telerik team
answered on 22 Sep 2008, 05:43 PM
Hello there,

Serrin is right but I would like to mention that you need to acquire the client-side instances of the ComboBoxes in the way described here.

The IDs of the ComboBoxes in the $find function calls in the example are hard-coded and in your case they may be different, hence the 'undefined' errors.

Greetings,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dominic
Top achievements
Rank 2
answered on 22 Sep 2008, 06:37 PM

Hi guys, first thanks for your answer !

If i put my usercontrol directly in a webform everything is going fine but in my case, the code for multiple comboboxes is in a usercontrol who is loaded by another usercontrol depending of the user's choice and in that case i have the ' LoadCountries is undefined' error.

Thanks in advance

0
Simon
Telerik team
answered on 23 Sep 2008, 11:39 AM
Hello Dominic,

Did you put the JavaScript code in the page with the Form as Serrin suggested? It is important to make sure that the script is available to the ComboBoxes.

All the best,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dominic
Top achievements
Rank 2
answered on 23 Sep 2008, 10:15 PM

Hi

I'm not sure how i can do that because i already have a <form> in my webform, so i cannot put another one in my usercontrol. In my case, i have a master usercontrol responsible for loading another one that contains the javascript and the multiple comboboxes. But, why the comboboxes cant't see the jsavascript  if my <USerControl2>  is inside the form ??? Here a little representation of my page structure :

<WebForm>
    <FORM>
        <Usercontrol1>
            <UserControl2>
                <Multiple Comboboxes>
            <UserControl2>
        </UserCOntrol1>
    </FORM>
</WebForm>

Like i said in my previous post, if i put my <usercontrol2> directly in the webform , everything is working great but i cant do that in that case...

Thanks for your helps...
0
Atanas Korchev
Telerik team
answered on 24 Sep 2008, 03:58 PM
Hello Dominic,

It would be best if you open a support ticket and send us the problematic project. We would inspect it for any problems and get back with a solution.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Dominic
Top achievements
Rank 2
Answers by
Serrin
Top achievements
Rank 1
Simon
Telerik team
Dominic
Top achievements
Rank 2
Atanas Korchev
Telerik team
Share this question
or