CascadingDropDown Extender (demo)

CascadingDropDown is an ASP.NET AJAX extender that can be attached to an ASP.NET DropDownList control to get automatic population of a set of DropDownList controls. Each time selection of one DropDownList control changes, CascadingDropDown makes a call to a specified web service to retrieve the list of values for the next DropDownList in the set.

Properties

Name Description
Category A category of this DropDownList (used when communicating with the helper web service).
ContextKey User/page specific context provided to an optional overload of the web method described by ServiceMethod/ServicePath. If the context key is used, it should have the same signature with an additional parameter named contextKey of the sting type.
EmptyText Optional text for an option displayed when the list is empty.
EmptyValue An optional value for an option displayed when the list is empty.
EnableAtLoading Determines wether or not to disable the DropDownList control when it is waiting for data from the service, so on loading a user can use the keyboard to navigate to the drop-down control.
LoadingText Optional text displayed by DropDownList when it is loading its data.
ParentControlID An optional ID of the parent DropDownList (on which the content of this control is based).
PromptText Optional text displayed by DropDownList a user has not yet touched. If omitted, the first dropdown item is selected.
PromptValue An optional value for an option displayed by DropDownList showing PromptText.
SelectedValue A selected value of the dropdown.
ServiceMethod The name of a web service method.
ServicePath A path to the helper web service.
UseContextKey Determines whether or not the ContextKey property should be used. It will be automatically enabled if the ContextKey property is ever set (either on the client or server side). If the context key is used, it should have the same signature with an additional parameter named contextKey of the string type.
UseHttpGet Determines whether or not to use the HTTP GET method for requesting data.

Methods

ParseKnownCategoryValuesString(knownCategoryValues)
A helper method to parse the private storage format used to communicate with known category/value pairs.
Params:
  • knownCategoryValues
    • Type:
    • Description: Private storage format string

QuerySimpleCascadingDropDownDocument(document, documentHierarchy, knownCategoryValuesDictionary, category)
A helper method to provide simple implementation of a method to query a data set and return relevant dropdown content.
Params:
  • document
    • Type:
    • Description: XML document containing the data set
  • documentHierarchy
    • Type:
    • Description: List of strings representing the hierarchy of the data set
  • knownCategoryValuesDictionary
    • Type:
    • Description: Known category/value pairs
  • category
    • Type:
    • Description: Category for which the drop down contents are desired

QuerySimpleCascadingDropDownDocument(document, documentHierarchy, knownCategoryValuesDictionary, category, inputValidationRegex)
A helper method to provide simple implementation of a method to query a data set and return relevant dropdown content.
Params:
  • document
    • Type:
    • Description: XML document containing the data set
  • documentHierarchy
    • Type:
    • Description: List of strings representing the hierarchy of the data set
  • knownCategoryValuesDictionary
    • Type:
    • Description: Known category/value pairs
  • category
    • Type:
    • Description: Category for which the drop down contents are desired
  • inputValidationRegex
    • Type:
    • Description: Regular expression used to validate user input to the web service (to prevent XPath injection attacks)

Client properties

category
A string containing a category of this dropdown.
Getter name: get_category()
Setter name: set_category(value)

contextKey
A string containing user or page-specific context provided to an optional overload of the Web method described by ServiceMethod or ServicePath.
Getter name: get_contextKey()
Setter name: set_contextKey(value)

emptyText
A string containing text for an option displayed when the list is empty.
Getter name: get_emptyText()
Setter name: set_emptyText(value)

emptyValue
A string containing a value for an option displayed when the list is empty.
Getter name: get_emptyValue()
Setter name: set_emptyValue(value)

enableAtLoading
Determines whether or not to disable the DropDownList control when it is waiting for data from the service, so on loading a user can use the keyboard to navigate to the drop-down control.
Getter name: get_enableAtLoading()
Setter name: set_enableAtLoading(value)

loadingText
A string containing loading text to to be displayed when getting the dropdown's values from the Web service.
Getter name: get_loadingText()
Setter name: set_loadingText(value)

parentControlID
A string containing an ID of a parent dropdown in a hierarchy of dropdowns.
Getter name: get_parentControlID()
Setter name: set_parentControlID(value)

promptText
A string containing prompt text that is displayed as the first entry in the dropdown.
Getter name: get_promptText()
Setter name: set_promptText(value)

promptValue
A string containing a value for an option displayed by DropDownList showing PromptText.
Getter name: get_promptValue()
Setter name: set_promptValue(value)

selectedValue
A string containing the selected value of the dropdown.
Getter name: get_selectedValue()
Setter name: set_selectedValue(value)

serviceMethod
A string containing the name of the method to invoke on the Web service.
Getter name: get_serviceMethod()
Setter name: set_serviceMethod(value)

servicePath
A string containing a path of the Web service. The default is page path
Getter name: get_servicePath()
Setter name: set_servicePath(value)

useContextKey
A boolean value that determines whether or not the ContextKey property should be used.
Getter name: get_useContextKey()
Setter name: set_useContextKey(value)

useHttpGet
Determines whether or not to use the HTTP GET method for requesting data.
Getter name: get_useHttpGet()
Setter name: set_useHttpGet(value)

Client events

populated
Fires after the control is populated.
Add event handler method: add_populated(handler)
Remove event handler method: remove_populated(handler)
Raise event method: raise_populated()

populating
Fires when the control is being populated.
Add event handler method: add_populating(handler)
Remove event handler method: remove_populating(handler)
Raise event method: raise_populating()

selectionChanged
Fires when selection is changed.
Add event handler method: add_selectionChanged(handler)
Remove event handler method: remove_selectionChanged(handler)
Raise event method: raise_selectionChanged()

Last edited Sep 14, 2015 at 11:05 AM by fadilmamedov, version 2