Can you use a RadComboBox in XMLHttpPanel?

3 posts, 1 answers
  1. Eric
    Eric avatar
    5 posts
    Member since:
    May 2009

    Posted 12 Nov 2009 Link to this post

    I'd like to know if it's possible to use a RadCombobox within an XMLHttpPanel. 

    My attempts thus far yield the following error:

    "XMLHttpPanel Callback Loading error: 
      Exception=Script control 'cmbo2' is not a registered script control.  Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
    Parameter name: scriptControl"

    My code looks like this:

    <%@ Page Language="VB" %> 
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" ""> 
    <script runat="server">  
        Protected Overrides Sub OnPreRender(ByVal e As EventArgs)  
            ScriptManager1.RegisterScriptControl(Of RadComboBox)(cmbo2)  
        End Sub  
        Protected Sub XmlHttpPanel_ServiceRequest(ByVal sender As Object, ByVal e As RadXmlHttpPanelEventArgs)  
            Dim val As String = e.Value  
            'Simulate a longer process  
            lbl1.Text = Now 
        End Sub  
    <html xmlns="">  
        <head id="Head1">  
            <script language="javascript" type="text/javascript">  
                function cmboChanged(sender, args) {  
                    var panel = $find("<%=RadXmlHttpPanel1.ClientID%>");  
        <form id="form1" method="post" runat="server">  
            <telerik:RadScriptManager runat="server" ID="ScriptManager1" /> 
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel> 
            <telerik:RadComboBox runat="server" ID="cmbo1" OnClientSelectedIndexChanged="cmboChanged" > 
                    <telerik:RadComboBoxItem Text="1" Value="1" /> 
                    <telerik:RadComboBoxItem Text="2" Value="2" /> 
                    <telerik:RadComboBoxItem Text="3" Value="3" /> 
                    <telerik:RadComboBoxItem Text="4" Value="4" /> 
                ID="RadXmlHttpPanel1" runat="server"   
                <telerik:RadComboBox runat="server" ID="cmbo2" > 
                        <telerik:RadComboBoxItem Text="1" Value="1" /> 
                        <telerik:RadComboBoxItem Text="2" Value="2" /> 
                        <telerik:RadComboBoxItem Text="3" Value="3" /> 
                        <telerik:RadComboBoxItem Text="4" Value="4" /> 
                <asp:Label runat="server" id="lbl1" /> 
  2. Steve
    Steve avatar
    1885 posts
    Member since:
    Dec 2008

    Posted 15 Nov 2009 Link to this post

    One of the other posts recommends trying to add this to the Combo
  3. Answer
    Pero avatar
    1156 posts

    Posted 16 Nov 2009 Link to this post

    Hi Steve,

    Yes it is possible to place a RadComboBox inside the RadXmlHttpPanel. When using any RadControl inside the Panel you need to set the RegisterWithScriptManager property to false. Also set the EnableClientScriptEvaluation property to true, so that the client scripts loaded from the RadComboBox are evaluated and you can use its client-side methods and properties.

    Do not hesitate to contact us if you have any other questions.

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top