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

RadComboBox inside Composite control javascript error

2 Answers 34 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 27 Sep 2011, 10:49 AM
Hi,
I am writing a server composite control which would reuse some of the RadComboBox functionality. When running a page which uses that control I am getting a JavaScript error (see the bottom of my post). I have narrowed the problem down to the RadComboBox itself. Is there any known fix to that?

Here is my server control (stripped as much as I can to produce the problem) :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
  
namespace ServerControl1
{
    [ToolboxData("<{0}:ScapaLoad runat=server></{0}:ScapaLoad>")]
    public class ScapaLoad : CompositeControl
    {
        RadComboBox _combo;
  
        [
            Category("Data"),
            Description("Data source ID for populating combo box"),
            PersistenceMode(PersistenceMode.Attribute)
        ]
        public string DataSourceID
        {
            get
            {
                EnsureChildControls();
                return _combo.DataSourceID;
            }
            set
            {
                EnsureChildControls();
                _combo.DataSourceID = value;
            }
        }
  
        [
            Category("Data"),
            Description("Database field with value to be used as a value of each combo box element"),
            PersistenceMode(PersistenceMode.Attribute)
        ]
        public string DataValueField
        {
            get
            {
                EnsureChildControls();
                return _combo.DataValueField;
            }
            set
            {
                EnsureChildControls();
                _combo.DataValueField = value;
            }
        }
  
        [
            Category("Data"),
            Description("Database field to be used as a visible text for chosen element from combo box"),
            PersistenceMode(PersistenceMode.Attribute)
        ]
        public string DataTextField
        {
            get
            {
                EnsureChildControls();
                return _combo.DataTextField;
            }
            set
            {
                EnsureChildControls();
                _combo.DataTextField = value;
            }
        }
  
  
        protected override void CreateChildControls()
        {
            Controls.Clear();
  
            _combo = new RadComboBox();
  
            Controls.Add(_combo);
        }
  
        protected override void RecreateChildControls()
        {
            EnsureChildControls();
        }
  
        protected override void Render(HtmlTextWriter writer)
        {
            AddAttributesToRender(writer);
            _combo.RenderControl(writer);
        }
    }
}


A page using the control (again, stripped down to just the control itself) :

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
  
<%@ Register Assembly="ServerControl1" Namespace="ServerControl1" TagPrefix="aspSample" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
          
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
  
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" EnableDelete="true" 
            ContextTypeName="TestLinqDataContext" EntityTypeName="" TableName="Users">
        </asp:LinqDataSource>
  
        <aspSample:ScapaLoad ID="ScapaLoad1" runat="server" 
            DataSourceID="LinqDataSource1" DataValueField="Name" DataTextField="Name" />
  
    </div>
    </form>
</body>
</html>

The javascript error I am getting is:

'undefined' is null or not an object  Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3ac9d03845-da3c-45e9-ab05-79ee502af576%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.2.712.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3af9722142-3e1c-4803-86df-ecfc0d24f144%3a16e4e7cd%3af7645509%3a24ee1bba%3af46195d3%3a1e771326%3aaa288e2d, line 6 character 74101


Please help, it is urgent. If you need any additional data please let me know and I will provide it if I can.

Thanks,

Daniel Gruszczyk

2 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
answered on 29 Sep 2011, 09:01 AM
Any updates from Telerik devs? Did you even have a look at the problem? Did you manage to replicate it? I really need some support on that...
0
Ivana
Telerik team
answered on 29 Sep 2011, 01:13 PM
Hello Daniel,

We could not reproduce the problem at our end.

Could you please send us a support ticket with this issue? Also, could you send us a runnable sample of your project, so we could easily examine and troubleshoot the problem?
(The database will not be necessary, we can test the sample using our own database.)

All the best,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
ComboBox
Asked by
Daniel
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 1
Ivana
Telerik team
Share this question
or