Cascading DropDown erreur 12031 ou 500

fouedelapoche Messages postés 36 Date d'inscription lundi 2 août 2004 Statut Membre Dernière intervention 30 octobre 2009 - 16 oct. 2007 à 14:22
jesusonline Messages postés 6814 Date d'inscription dimanche 15 décembre 2002 Statut Membre Dernière intervention 13 octobre 2010 - 16 oct. 2007 à 15:31
Bonjour,

j'essaye simplement de mettre en place un cascadingdropdown en place, et invaraiblement j'ai toujours l'erreur 12031 au lieu de la liste de mes valeurs.
la strucutre de mon code est la suivante :

un page default.aspx comportant un script manager,

un usercontrol se trouvant dans le dossier UserControl qui contient le code suivant :

 
                    <cc1:CascadingDropDown ID="CascadingDropDownCategorie"
                    runat="server"
                    Category="Categorie"
                    PromptText="Choisir une catégorie"
                    ServiceMethod="getCategorie"
                    ServicePath="../WebServices/ws_realEstateType.asmx"
                    TargetControlID="listCategorie">
                    </cc1:CascadingDropDown>
                </td>
                <td>
                    </td><td>
                   
                        <cc1:CascadingDropDown
                        ID="CascadingDropDownType"
                        runat="server"
                        Category="Type"
                        ParentControlID="listCategorie"
                        PromptText="Choisir un type..."
                        ServiceMethod="getType"
                        ServicePath="../WebServices/ws_realEstateType.asmx"
                        TargetControlID="listType">
                        </cc1:CascadingDropDown>

un webService se trouvant dans le dossier WebServices :

using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using AjaxControlToolkit;
using System.Collections.Generic;
using System.Collections.Specialized;
using SopraTools.DAL;
using System.Web.Script.Services;
using System.Windows.Forms;

/// <summary>
/// Summary description for ws_realEstateType
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService()]
public class ws_realEstateType : System.Web.Services.WebService
{

    public ws_realEstateType()
    {

        //Uncomment the following line if using designed components
        //InitializeComponent();
    }

    [WebMethod]
    [System.Web.Script.Services.ScriptMethod()]
    public static CascadingDropDownNameValue[] getType(string knownCategoryValues, string category)
    {
        List<CascadingDropDownNameValue> dropDownType = new List<CascadingDropDownNameValue>();
        try
        {
          
            dropDownType.Add(new CascadingDropDownNameValue("toto", "tata"));
            dropDownType.Add(new CascadingDropDownNameValue("ttuu", "tiiti"));

            return dropDownType.ToArray();
        }
        catch (Exception ex)
        {
    
            return null;
        }
         
    }
    [WebMethod]
    [System.Web.Script.Services.ScriptMethod()]
    public static CascadingDropDownNameValue[] getCategorie(string knownCategoryValues, string category)
    {
     
        List<CascadingDropDownNameValue> dropDownType = new List<CascadingDropDownNameValue>();
        try{
   
        dropDownType.Add(new CascadingDropDownNameValue("coucou", "caucau"));
        dropDownType.Add(new CascadingDropDownNameValue("coco", "tztz"));
        return dropDownType.ToArray();
        }
            catch(Exception ex)
        {
     
            return null; 
        }

    }
}

mon webservice est assez vide, mais c'est juste histoire de faire fonctionner  le cascading dropdown .... J'ai éclusé pas mal de forum sans succès... Alors une idée ?

bonne journée.

1 réponse

jesusonline Messages postés 6814 Date d'inscription dimanche 15 décembre 2002 Statut Membre Dernière intervention 13 octobre 2010 29
16 oct. 2007 à 15:31
Bonjour,

regarde avec Fiddler, HttpWatch, Firebug pour voir ce qui transite si tu trouves rien met un point d'arret dans la méthode getCategorie du webservice tu trouveras surement pourquoi ca plante.

En cas d'erreur 500 tu aussi des logs dans les journaux windows.

<hr />Cyril - MSP - MCPD ASP.net & MCTS SQL - Consultant indépendant
0
Rejoignez-nous