+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / CascadingDropDown, error 12031

CascadingDropDown, error 12031

10 posts, 0 answered
  1. May
    May avatar
    36 posts
    Registered:
    12 Apr 2007
    15 Dec 2007
    Link to this post
    Greeting!

    When I tried to using CascadingDropDown in my controls, I alwasy get Method error 12031. I did all the web.config changes and the same code works fine in a regular .aspx page using the same config file. Using Sitefinity 3.,1, VS 2005.

    Anybody using CascadingDropDown, please help!

    Thanks in advance!
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    15 Dec 2007
    Link to this post
    Hello May,

    Please investigate the following article that discusses a possible solution for the described problem with the  CascadingDropDown control.

    Hope this helps.

    Regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. May
    May avatar
    36 posts
    Registered:
    12 Apr 2007
    15 Dec 2007
    Link to this post
    Hi Pepi,

    Thank you for the suggestion.

    The webservice has been decorated with Script.Services.ScriptService(), and web method decorated with Script.Services.ScriptMethod(). If something wrong with the webservice, the same code should NOT work for regular ASPX page.

    Any other ideas?

    Thanks!
  4. Tihomir
    Tihomir avatar
    53 posts
    Registered:
    24 Sep 2012
    17 Dec 2007
    Link to this post
    Hi May,

    Can you please paste the problem-causing code so we can test and debug it locally?

    Kind regards,
    Tihomir
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. May
    May avatar
    36 posts
    Registered:
    12 Apr 2007
    17 Dec 2007
    Link to this post
    Here is my usercontrol code which is not workin, but if you chage the usercontrol to a page, it is working. It seems that the WebMethod is not get called in the usercontrol.
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %> 
     
    <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
        Namespace="System.Web.UI" TagPrefix="asp" %> 
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> 
     
      <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>   
     
    <asp:DropDownList ID="DropDownList2" runat="server" Width="277px">  
                </asp:DropDownList><br /> 
                <cc1:CascadingDropDown ID="CascadingDropDown2" runat="server"     
     TargetControlID="DropDownList2" Category="Operation"   
     PromptValue="Please select "   ServiceMethod="GetOperationsPage">  
                       </cc1:CascadingDropDown>          
              
    <cc1:CascadingDropDown ID="CascadingDropDown1" runat="server"     
    ServiceMethod="GetEmployeesForOperationPage" TargetControlID="DropDownList1" Category="Employee"   
    ParentControlID="DropDownList2" PromptValue="Please select "  > 
                       </cc1:CascadingDropDown> 
                          
    <asp:DropDownList ID="DropDownList1" runat="server">  
    </asp:DropDownList> 
    </radA:RadAjaxPanel> 
    Code behind:
    using System;  
    using System.Data;  
    using System.Configuration;  
    using System.Collections;  
    using System.Web;  
    using System.Web.Security;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
    using System.Web.UI.WebControls.WebParts;  
    using System.Web.UI.HtmlControls;  
     
    using System.Web.Services;  
    using AjaxControlToolkit;  
    using System.Collections.Specialized;  
     
    public partial class WebUserControl : System.Web.UI.UserControl  
    {  
        [WebMethod]  
        [System.Web.Script.Services.ScriptMethod()]  
        //[System.Web.Script.Services.ScriptMethodAttribute]  
        public static CascadingDropDownNameValue[] GetEmployeesForOperationPage(string knownCategoryValues, string category)  
        {  
            EmplpyeeByOperation cs = new EmplpyeeByOperation();  
            return cs.GetEmployeesForOperation(knownCategoryValues, category);  
     
     
        }  
        [WebMethod]  
        [System.Web.Script.Services.ScriptMethod()]  
        //[System.Web.Script.Services.ScriptMethodAttribute]  
        public static CascadingDropDownNameValue[] GetOperationsPage(string knownCategoryValues, string category)  
        {  
            EmplpyeeByOperation cs = new EmplpyeeByOperation();  
            return cs.GetOperations(knownCategoryValues, category);  
     
     
        }  
          
          
        protected void Page_Load(object sender, EventArgs e)  
        {  
     
        }  
    WebServince:
    using System;  
    using System.Web;  
    using System.Collections;  
    using System.Web.Services;  
    using System.Web.Services.Protocols;  
    using AjaxControlToolkit;  
    using System.Collections.Specialized;  
    using System.Collections.Generic;  
    using StanleySteemer.CorporateDB.Service;  
    using StanleySteemer.CorporateDB.BLL;  
     
    /// <summary> 
    /// Summary description for EmplpyeeByOperation  
    /// </summary> 
    [WebService(Namespace = "http://tempuri.org/")]  
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]  
    [System.Web.Script.Services.ScriptService()]  
     
    public class EmplpyeeByOperation : System.Web.Services.WebService  
    {  
     
        public EmplpyeeByOperation()  
        {  
              
            //Uncomment the following line if using designed components   
            //InitializeComponent();   
        }  
     
        [WebMethod]  
        [System.Web.Script.Services.ScriptMethod()]  
        public CascadingDropDownNameValue[] GetOperations(string knownCategoryValues, string category)  
        {  
              
     
            ViewOperationService ss = new ViewOperationService();  
            VList<ViewOperation> el = ss.Get("number = 4000" , "Name");  
     
            List<CascadingDropDownNameValue> vaules = new List<CascadingDropDownNameValue>();  
            foreach (ViewOperation p in el)  
            {  
                vaules.Add(new CascadingDropDownNameValue((string)p.Name, p.OperationId.ToString()));  
            }  
     
            return vaules.ToArray();  
     
        }  
     
     
        [WebMethod]  
        [System.Web.Script.Services.ScriptMethod()]  
        public CascadingDropDownNameValue[] GetEmployeesForOperation(string knownCategoryValues, string category)  
        {  
            StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);  
            int operId =1;  
            if (!kv.ContainsKey("Operation") || !Int32.TryParse(kv["Operation"], out operId))  
            {  
                return null;  
            }  
                 
            ViewEmployeeService ss = new ViewEmployeeService();  
            VList<ViewEmployee> el = ss.Get("OperationId = " + operId, "Name");  
     
            List<CascadingDropDownNameValue> vaules = new List<CascadingDropDownNameValue>();  
            foreach (ViewEmployee p in el)  
            {  
                vaules.Add(new CascadingDropDownNameValue((string)p.Name, p.EmployeeId.ToString()));  
            }  
     
            return vaules.ToArray();  
     
        }  
     
     
    }  
     
     

    Thanks for your help!

  6. May
    May avatar
    36 posts
    Registered:
    12 Apr 2007
    17 Dec 2007
    Link to this post
    Hi Tihomir ,

    Just found out,  no support for web methods in user controls at this moment. But I always make usercontrols in Sitefinity, I guess I can't use it for now.

    Thanks!
  7. May
    May avatar
    36 posts
    Registered:
    12 Apr 2007
    17 Dec 2007
    Link to this post

    PageMethod is not working is usercontrol, so I changed to call the webservice from the usercontrol. here is working version usercontrol, but I try to load the usercontrol to mysite, I got error: "Only one instance of a ScriptManager can be added to the page. ", even I renove the ScriptManager from my usercontrol, I still get the same error?

    Any Suggestions!?

    Thanks!

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl"  %> 
     
    <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
        Namespace="System.Web.UI" TagPrefix="asp" %> 
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> 
     
      <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>   
     
    <asp:DropDownList ID="DropDownList2" runat="server" Width="277px">  
                </asp:DropDownList><br /> 
                <cc1:CascadingDropDown ID="CascadingDropDown2" runat="server"     
     TargetControlID="DropDownList2" Category="Operation"   ServicePath="~/EmplpyeeByOperation.asmx" 
     PromptValue="Please select "   ServiceMethod="GetOperations">  
                       </cc1:CascadingDropDown>          
              
    <cc1:CascadingDropDown ID="CascadingDropDown1" runat="server"     
    ServiceMethod="GetEmployeesForOperation" TargetControlID="DropDownList1" Category="Employee"   
    ParentControlID="DropDownList2" PromptValue="Please select "  ServicePath="~/EmplpyeeByOperation.asmx" > 
                       </cc1:CascadingDropDown> 
                          
    <asp:DropDownList ID="DropDownList1" runat="server">  
    </asp:DropDownList> 
    </radA:RadAjaxPanel> 

     

    Only one instance of a ScriptManager can be added to the page.

     

    Only one instance of a ScriptManager can be added to the page.

  8. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    18 Dec 2007
    Link to this post
    Hi May,

    It is a known issue in the old versions of Sitefinity. The described problem was fixed for v3.1 SP1. So I would recommend you upgrade your project to the newest Sitefinity version.

    Let us know how it goes.

    Kind regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. May
    May avatar
    36 posts
    Registered:
    12 Apr 2007
    30 Dec 2007
    Link to this post
    Actually I was using 3.1SP1.  It would be nice that somewhere in Admin page shows what version SP I have applied.

    Thanks!
  10. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    02 Jan 2008
    Link to this post
    Hi May,

    Thanks a lot for the suggestion to display Sitefinity version in the administration website.

    For now, in order to verify what version you have applied, please check the version of the Telerik.Cms.dll in the ~/bin folder of your project. It should be 3.1.1442.2, 3.1.1448.2 or 3.1.1458.2 for v3.1 SP1 depending on the build you have downloaded and 3.1.1473.2 for v3.1 SP2. Alternatively, you can also check the version from your Web Browser if you view one of the website pages. In the HTML source, please check the content attribute of meta tag with name Generator. For example:

    <meta name="Generator" content="Sitefinity 3.1.1458.2:0" /> 

    Kind regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
10 posts, 0 answered