|
Limit a dropdown on the Web Forms based on a value in another dropdown. |
Home > Support > Developers > AS Web Forms > Design Patterns > Limit a dropdown on the Web Forms based on a value in another dropdown. Limit a dropdown on the Web Forms based on a value in another dropdown.Sometimes, you may have a set of drop downs on a single AS Web Form that rely on one another. For an example, consider State and County. The following pattern may be used on the page hosting the ASWebForms ASDataEditor control: In your code behind, add an object to server as a reference to your data editor: Protected WithEvents ctlASDataEditor As ASWebForms.AlgonquinStudios.Controls.ASDataEditor Then, set a reference to this in the Page_Load event: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Finally, add code to the ctlASDataEditor_PreRender event which will perform the appropriate look-up changes and reset the drop down: Private Sub ctlASDataEditor_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles ctlASDataEditor.PreRenderDim cboState As System.Web.UI.HtmlControls.HtmlSelect |
| ©2001-2008 Algonquin Studios, Inc. | info@quantumcms.com | (716) 842-1439 |
Site Map
QuantumCMS is a product of Algonquin Studios. |