So I have this on the front end:
<%= Html.DropDownListFor(m => m.FixedComponent.PaymentBusinessDayConvention, DropDownData.BusinessDayConventionList(), "", new { @class = "DontShrink", propertyName = "FixedComponent.PaymentBusinessDayConvention", onchange = "UpdateField(this);" })%>
The DropDownData.BusinessDayConventionList()
is defined here:
public static SelectList BusinessDayConventionList()
{
return ListBuilder(
BusinessDayConventionHelper.GetFriendlyName(BusinessDayConvention.Following),
BusinessDayConventionHelper.GetFriendlyName(BusinessDayConvention.ModifiedFollowing),
BusinessDayConventionHelper.GetFriendlyName(BusinessDayConvention.Preceding),
BusinessDayConventionHelper.GetFriendlyName(BusinessDayConvention.Unadjusted));
}
I want to remove the BusinessDayConvention.Unadjusted
option for JUST the one HTML Helper, but not for all of the other ones on the page. How can I do this cleanly?
Thanks!
Include a parameter to the method:
You can also have an overload to pass a default value: