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

Can you use a RadComboBox in XMLHttpPanel?

2 Answers 128 Views
XmlHttpPanel
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 12 Nov 2009, 09:53 PM
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 Answers, 1 is accepted

Sort by
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 16 Nov 2009, 02:47 AM
One of the other posts recommends trying to add this to the Combo
RegisterWithScriptManager="false"
0
Accepted
Pero
Telerik team
answered on 16 Nov 2009, 12:31 PM
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.
Tags
XmlHttpPanel
Asked by
Eric
Top achievements
Rank 1
Answers by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Pero
Telerik team
Share this question
or