I'm creating a DotNetNuke 4.x module, and need an AJAX CascadingDropDown in my module. I have it defined as follows...
<asp:UpdatePanel runat="server" ID="CascadingDropDowns">
<ContentTemplate>
<asp:DropDownList runat="server" ID="SelectGroupDropDownList">
</asp:DropDownList>
<ajax:CascadingDropDown runat="server" ID="SelectGroupDropDownListExtender" Category="Group"
TargetControlID="SelectGroupDropDownList" PromptText="Select a Group" ServiceMethod="GetGroups">
</ajax:CascadingDropDown>
<!-- more dropdowns & cascadingdropdown extenders here -->
With the page method defined in the codebehind of the ascx like this...
[WebService]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService()]
public partial class EligibilityView : PortalModuleBase
{
[WebMethod]
[ScriptMethod]
public CascadingDropDownNameValue[] GetGroups(string knownCategoryValues, string category)
{
var results = new List<CascadingDropDownNameValue>();
// code here to fill the list with values...
return results.ToArray();
}
When I run the page, I get a "[Method error 500]" - and can't figure out what the heck I'm doing wrong. I think that the problem is that the page can't find the webmethod because its defined inside the ASCX control and not the page itself. I do need to keep it defined this way - and not create an ASMX service - since this is going to be compiled into a module for DotNetNuke and I want to keep things simple inside the module.
Any suggestions would be greatly appreciated.