CascadingDropDowns in VB

Last post 01-08-2008 10:42 AM by blackSwan. 4 replies.

Sort Posts:

  • CascadingDropDowns in VB

    04-24-2006, 3:21 PM
    • Member
      160 point Member
    • Flugelboy2000
    • Member since 03-16-2004, 1:25 PM
    • St. Pete, FL
    • Posts 32

    I'm trying to convert the CascadingDropDown list sample to VB and I'm running into a problem.  When I view the page, there are no errors but the dropdown lists don't populate.  It doesn't seem like the webservice is being run.  The reason I say this is beacuse if I change the "ServicePath" property on the aspx page to point to a nonexistant file, I get the exact same results....No error and no data in the lists.  But I figure that if the ServicePath that Im pointing at doesn't exist, I should be getting an error.  Here is my code for the .vb service and the .aspx code.  What am I missing?

     

     
        Inherits System.Web.Services.WebService
        Private ReadOnly _document as New XmlDocument()
        Private ReadOnly _hierarchy() as String
     
        Public Sub CarsService()
            'Read XML data from disk
    
             _document.Load(Server.MapPath("~/App_Data/CarsService.xml"))
    
            _hierarchy(0) = "Make"
            _hierarchy(1) = "Model"
    
         End Sub
    
        <WebMethod()> _
        Public Function GetDropDownContents(ByVal knownCategoryValues As String, ByVal category As String) As AtlasControlToolkit.CascadingDropDownNameValue()
    
            Dim knownCategoryValuesDictionary as New StringDictionary
            knownCategoryValuesDictionary = AtlasControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)
    
            Return AtlasControlToolkit.CascadingDropDown.QuerySimpleCascadingDropDownDocument(_document, _hierarchy, knownCategoryValuesDictionary, category)
        End Function
      
    <atlas:ScriptManager id="ScriptManager1" EnablePartialRendering="true" runat="server"></atlas:ScriptManager>    
    <atlas:UpdatePanel ID="UpdatePanel1" runat="server">
    <contenttemplate>
    <table>
    <tr>
        <td>Make</td>
        <td><asp:DropDownList ID="DropDownList1" runat="server" Width="170" /></td>
    </tr>
    <tr>
        <td>Model</td>
        <td><asp:DropDownList ID="DropDownList2" runat="server" Width="170" /></td>
    </tr>
    <tr>
        <td>Color</td>
        <td><asp:DropDownList ID="DropDownList3" runat="server" Width="170" /></td>
    </tr>
    </table>
    <br />
    <asp:Button ID="Button1" runat="server" Text="I want this car" OnClick="Button1_Click" />
    <br />
    <br />
    <asp:Label ID="Label1" runat="server" Text="[No response provided yet]"></asp:Label>
    </contenttemplate>
    </atlas:UpdatePanel>
    
    <atlasToolkit:CascadingDropDown id="CascadingDropDown1" runat="server">
    	<atlasToolkit:CascadingDropDownProperties TargetControlID="DropDownList1" Category="Make"
    		PromptText="Please select a make" ServicePath="CarsService.asmx" ServiceMethod="GetDropDownContents" />
    	<atlasToolkit:CascadingDropDownProperties TargetControlID="DropDownList2" Category="Model"
    		PromptText="Please select a model" ServicePath="CarsService.asmx" ServiceMethod="GetDropDownContents"
    		ParentControlID="DropDownList1" />
    	<atlasToolkit:CascadingDropDownProperties TargetControlID="DropDownList3" Category="Color"
    		PromptText="Please select a color" ServicePath="CarsService.asmx" ServiceMethod="GetDropDownContents"
    		ParentControlID="DropDownList2" />
    </atlasToolkit:CascadingDropDown>
    </form>
     
  • Re: CascadingDropDowns in VB

    04-24-2006, 5:10 PM
    • Contributor
      4,346 point Contributor
    • sburke_msft
    • Member since 04-04-2006, 7:28 PM
    • Redmond, WA
    • Posts 770
    • AspNetTeam

    Hmmm - the code looks okay to me.  Two questions:

    1) Does the sample website page for CascadingDropDown work okay?

    2) If you put a breakpoint in the web service, can you verify that it does or doesn't work

     

    Don't forget, this posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: CascadingDropDowns in VB

    06-26-2006, 3:00 AM
    • Member
      10 point Member
    • l_ormerod
    • Member since 06-26-2006, 6:54 AM
    • Posts 2

    Make sure that your Web.Config is updated to allow browser access to web services.  You can find details at this link:

    http://atlas.asp.net/docs/atlas/doc/services/exposing.aspx#enable

    If you don't then I think you'll find that your drop-down lists will not be populated!

    Hope this helps

  • Re: CascadingDropDowns in VB

    01-07-2008, 3:49 PM
    • Member
      2 point Member
    • ymorales
    • Member since 01-07-2008, 8:45 PM
    • Posts 1

    Question:

     I'm having similar issues translating the webservice to VB. (I'm fairly new to developing). In my case the Webservice will look at a database. 

    Q: My whole website is in VB, can I write the WebService in C# and have it work?

    regards

  • Re: CascadingDropDowns in VB

    01-08-2008, 10:42 AM
    • Member
      2 point Member
    • blackSwan
    • Member since 01-08-2008, 10:20 AM
    • Posts 1

     I am able to populate the dropdowns using the webservice. However, after i save the selected dropdown values into the database, I am unable to set these dropdown values in the pageload.  Can someone help me with this issue?

Page 1 of 1 (5 items)