title: CascadingDropDown Missing parameter: knownCategoryValues
body: <p>I am having some trouble getting CascadingDropDown lists to work, its displaying the Method 500 error inside the list. I have tried all the common solutions to this and still no luck.</p>
  
  <p>I was originally getting the following error:</p>
  
  <blockquote>
    <p>System.ArgumentException: Invalid
    method name &#39;getcategories&#39;, 
    method names are case sensitive.   The
    method name &#39;GetCategories&#39;
    with the same name but different
    casing was found. Parameter name:
    methodName</p>
  </blockquote>
  
  <p>Which is odd because I am definately setting the method name in the correct case but it was sending it in lowercase (even though chrome showed the page as sending it in the correct case). Anyhow I worked around this by changing the method name itself to lowercase. This now brings up a new error:</p>
  
  <blockquote>
    <p>System.InvalidOperationException:
    Missing parameter:
    knownCategoryValues.</p>
  </blockquote>
  
  <p>If anyone could shed any light on either of these problems that would be a great help, I've spent way too long on this problem.</p>
  
  <p>Thanks.</p>
  
  <p>UPDATED Code:</p>
  
  <pre><code>&lt;ajaxToolkit:ToolkitScriptManager EnablePageMethods="true" ID="ToolkitScriptManager1" runat="server"&gt;
  &lt;/ajaxToolkit:ToolkitScriptManager&gt;
  &lt;ajaxToolkit:CascadingDropDown
      ID="CascadingDropDown1"
      runat="server"
      TargetControlID="mmCategory" 
      Category="Category" 
      PromptText="Select a category" 
      ServicePath="~/DropDownLists.asmx"
      ServiceMethod="GetCategories" /&gt;
  &lt;ajaxToolkit:CascadingDropDown
      ID="CascadingDropDown2"
      runat="server"
      TargetControlID="mmTemplate"
      ParentControlID="mmCategory"
      PromptText="Select a template"
      ServiceMethod="GetTemplates"
      ServicePath="~/DropDownLists.asmx"
      Category="Template" /&gt;
  Category: &lt;asp:DropDownList ID="mmCategory" runat="server"/&gt;&lt;br/&gt;
  Template: &lt;asp:DropDownList ID="mmTemplate" runat="server"/&gt;&lt;br/&gt;
  </code></pre>
  
  <p>Web Service File:</p>
  
  <pre><code>using System;
  using System.Web;
  using System.Collections;
  using System.Collections.Generic;
  using System.Collections.Specialized;
  using System.Web.Services;
  using System.Web.Services.Protocols;
  using AjaxControlToolkit;
  using System.Data;
  using System.Data.SqlClient;
  using System.Configuration;
  using System.Linq;
  
  /// &lt;summary&gt;
  /// Summary description for TemplateData
  /// &lt;/summary&gt;
  [WebService(Namespace = "http://tempuri.org/")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  [System.Web.Script.Services.ScriptService()]
  
  public class DropDownLists : System.Web.Services.WebService
  {
  
      public DropDownLists()
      {
          //Uncomment the following line if using designed components 
          //InitializeComponent(); 
      }
  
      [System.Web.Services.WebMethod]
      [System.Web.Script.Services.ScriptMethod]
      public CascadingDropDownNameValue[] getcategories(string knownCategoryValues, string category)
      {
  
          List&lt;CascadingDropDownNameValue&gt; values = new List&lt;CascadingDropDownNameValue&gt;();
          values.Add(new CascadingDropDownNameValue("test 1", "1"));
          values.Add(new CascadingDropDownNameValue("test 2", "2"));
          return values.ToArray();
  
          /*using (MiscDataContext dc = new MiscDataContext())
          {
              var CatQuery = from D in dc.Templates
                          select new {  D.Category  }
                              into CatQueryResults
                                  select CatQueryResults;
  
                  foreach (var CatResult in CatQuery)
                  {
                      string CatReturn = CatResult.Category;
                      values.Add(new CascadingDropDownNameValue(CatReturn, CatReturn));
                  }
                  return values.ToArray();
           }*/
  
      }
  
  
      [System.Web.Services.WebMethod]
      [System.Web.Script.Services.ScriptMethod]
      public CascadingDropDownNameValue[] GetTemplates(string knownCategoryValues, string category)
      {
  
          StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
          string varCat;
          varCat = kv["Category"];
  
  
          List&lt;CascadingDropDownNameValue&gt; values = new List&lt;CascadingDropDownNameValue&gt;();
          values.Add(new CascadingDropDownNameValue("test 3", "3"));
          values.Add(new CascadingDropDownNameValue("test 4", "4"));
          return values.ToArray();
          /*using (MiscDataContext dc = new MiscDataContext())
          {
              var CatQuery = from D in dc.Templates
                          where(D.Category == varCat)
                          select new {  D.ID, D.Name  }
                          into CatResult
                          select CatResult;
  
                  foreach (var CatResult in CatQuery)
                      {
                          int ID = (int)CatResult.ID;
                          string Name = CatResult.Name;
                          values.Add(new CascadingDropDownNameValue(Name, Convert.ToString(ID)));
                      }
                      return values.ToArray();
              }*/
          }
  }
  </code></pre>