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" "http://www.w3.org/tr/xhtml11/DTD/xhtml11.dtd"> 
     
    <script runat="server">  
        Protected Overrides Sub OnPreRender(ByVal e As EventArgs)  
            MyBase.OnPreRender(e)  
            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  
            System.Threading.Thread.Sleep(1000)  
     
            cmbo2.Items.Clear()  
            lbl1.Text = Now 
        End Sub  
          
    </script> 
     
    <html xmlns="http://www.w3.org/1999/xhtml">  
        <head id="Head1">  
            <title></title>  
              
            <script language="javascript" type="text/javascript">  
                function cmboChanged(sender, args) {  
                    var panel = $find("<%=RadXmlHttpPanel1.ClientID%>");  
                    panel.set_value("");  
                }  
            </script>                  
                      
        </head> 
        <body> 
        <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" > 
                <Items> 
                    <telerik:RadComboBoxItem Text="1" Value="1" /> 
                    <telerik:RadComboBoxItem Text="2" Value="2" /> 
                    <telerik:RadComboBoxItem Text="3" Value="3" /> 
                    <telerik:RadComboBoxItem Text="4" Value="4" /> 
                </Items> 
            </telerik:RadComboBox> 
     
            <telerik:RadXmlHttpPanel   
                ID="RadXmlHttpPanel1" runat="server"   
                LoadingPanelID="RadAjaxLoadingPanel1" 
                OnServiceRequest="XmlHttpPanel_ServiceRequest">  
                <telerik:RadComboBox runat="server" ID="cmbo2" > 
                    <Items> 
                        <telerik:RadComboBoxItem Text="1" Value="1" /> 
                        <telerik:RadComboBoxItem Text="2" Value="2" /> 
                        <telerik:RadComboBoxItem Text="3" Value="3" /> 
                        <telerik:RadComboBoxItem Text="4" Value="4" /> 
                    </Items> 
                </telerik:RadComboBox>      
                  
                <asp:Label runat="server" id="lbl1" /> 
                              
            </telerik:RadXmlHttpPanel> 
     
            </form> 
        </body> 
    </html> 
     
     
  2. Steve
    Steve avatar
    1851 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
    RegisterWithScriptManager="false"
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Pero
    Admin
    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,
    Pero
    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