Skip to content

LinkedDropdownHelper

Renders a <select> whose options carry a data-parent-id/CSS-class hook so client-side script can filter its visible options based on a parent field's selected value — a "chained dropdown" pattern used across Business Online forms.

Purpose

  • Renders a <select> whose options carry a data-parent-id/CSS-class hook so client-side script can filter its visible options based on a parent field's selected value — a "chained dropdown" pattern used across Business Online forms.

Context

  • Namespace: SAIF.Web.Mvc.UI.Extensions
  • Assembly/package: SAIF.Framework.Web.Mvc (source-shipping NuGet package)
  • Kind: static class

Public members

Member Signature Purpose
LinkedDropdownListFor public static MvcHtmlString LinkedDropdownListFor<TModel, TProperty>(this HtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, string parent, IEnumerable<LinkedSelectListItem> items, bool removeDefault = false, object htmlAttributes = null) Strongly-typed overload that resolves the field name from the lambda and delegates to LinkedDropdownList.
LinkedDropdownList(this HtmlHelper, string name, string parent, IEnumerable items, bool removeDefault = false, object htmlAttributes = null) public static MvcHtmlString LinkedDropdownList(this HtmlHelper html, string name, string parent, IEnumerable<LinkedSelectListItem> items, bool removeDefault = false, object htmlAttributes = null) Builds the <select> element, one <option> per item, optionally skipping the conventional -1 "please select" entry; see the "Render a linked (chained) dropdown" operation.

Sources

  • src/Web.Mvc/UI/Extensions/LinkedDropdownHelper.cs