locked
no value returned from cascadingdropdown RRS feed

  • Question

  • User944339287 posted

    hi guys, I using CascadingDropdown to get automatic population of 2 set of DropDownList controls.

    I wonder why in Page_Load, SelectedValue = "" in both dropdownlist

    BUT in btn_search_Click, SelectedValue is display accordingly. Please advise. TQ

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
            If Page.IsPostBack = False Then
                BindGrid_product()
            End If
    
        End Sub
    
        Protected Sub btn_search_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btn_search.Click
            BindGrid_product()
        End Sub
    
        Private Sub BindGrid_product()
    
            Dim ParentCatID As String = Me.ddl_category_parent.SelectedValue
            Dim ChildCatID As String = Me.ddl_category_child.SelectedValue
    
        End Sub

    Wednesday, October 23, 2013 11:56 AM

All replies

  • User2117486576 posted

    I wonder why in Page_Load, SelectedValue = "" in both dropdownlist

    Are you talking about when Page_Load executes in response to the search button click or another event?

    If the latter, then show how you are initializing the dropdowns in the page_load().

    Wednesday, October 23, 2013 12:32 PM
  • User944339287 posted

    Hi RichardY,

    I using webservice to return items of dropdownlist

    <tr><td>
        <cc1:cascadingdropdown id="cdd_category_parent" runat="server" category="ParentCat" loadingtext="loading..." promptvalue="Select a parent category" servicemethod="GetParentCategory" servicepath="~/webservices/category.asmx" targetcontrolid="ddl_category_parent"></cc1:cascadingdropdown>
        <cc1:cascadingdropdown id="cdd_category_child" runat="server" category="ChildCat" loadingtext="loading..." parentcontrolid="ddl_category_parent" promptvalue="Select a child category" servicemethod="GetChildCategory" servicepath="~/webservices/category.asmx" targetcontrolid="ddl_category_child" EmptyText="No child category" EmptyValue="0"></cc1:cascadingdropdown>
    </td></tr>



    Wednesday, October 23, 2013 11:34 PM
  • User944339287 posted

    Hi Future200,

    As mentioned, i using webservices to return items of dropdownlist. I need to get value in the page load as I want it to show some search result when page initilize. Tq

    Wednesday, October 23, 2013 11:36 PM