Saturday, March 24, 2012

Cascadingdropdown working with web methods

Hi,

I am using the Cascadingdropdown as below

<atlasToolkit:CascadingDropDownID="CascadingDropDown1"runat="server">

<atlasToolkit:CascadingDropDownPropertiesTargetControlID="DropDownList1"Category="Principal"PromptText="Please select Principal"LoadingText="[Loading Principals...]"ServiceMethod="GetDropDownContentsPageMethod"/>

<atlasToolkit:CascadingDropDownPropertiesTargetControlID="DropDownList2"Category="MessageType"PromptText="Please select message type"LoadingText="[Loading Message Types...]"ServicePath=""ServiceMethod="GetDropDownContents1"ParentControlID="DropDownList1"/>

</atlasToolkit:CascadingDropDown>

<asp:DropDownListID="DropDownList1"runat="server">

</asp:DropDownList>

<asp:DropDownListID="DropDownList2"runat="server"/>

And the code behind is

<WebMethod()> _

PublicFunction GetDropDownContentsPageMethod(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As AtlasControlToolkit.CascadingDropDownNameValue()

Dim lobjDALAs VOSS.Integrations.Web.DataAccess.XmlAdmin

Try

lobjDAL =New VOSS.Integrations.Web.DataAccess.XmlAdmin

Return lobjDAL.GetRegions(knownCategoryValues, category)

Catch exAs Exception

ReturnNothing

Finally

lobjDAL =Nothing

EndTry

EndFunction

<WebMethod()> _

PublicFunction GetDropDownContents1(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As AtlasControlToolkit.CascadingDropDownNameValue()

Dim lobjDALAs VOSS.Integrations.Web.DataAccess.XmlAdmin

Try

lobjDAL =New VOSS.Integrations.Web.DataAccess.XmlAdmin

Return lobjDAL.GetDropDownContents2(knownCategoryValues, category)

Catch exAs Exception

ReturnNothing

Finally

lobjDAL =Nothing

EndTry

ReturnNothing

EndFunction

Now the first function works and retrieves the values, but the second function does not. I am not using a web service. Do I need to always use a webservice for this. Can both the methods not pick values directly from db?

Pleae assist

Regards

Raj

Hi Raj,

You should check outFAQ Item #20.

Thanks,
Ted

No comments:

Post a Comment