ASP.NET MVC Bootstrap 表单助手
ASP.NET MVC Bootstrap Form Helper
您好,我使用来自 bootstrap 的国家 select 表单助手,但是如何将其与模型绑定?
通常我使用
@Html.TextAreaFor(m => m.Attribute, new { @class = "form-control col-md-2", required = "required" })
但这里我只有 div,我想将 select 国家/地区列表中的数据传递给模型,但不知道如何。谁能帮帮我?
<div class="bfh-selectbox bfh-countries col-md-3" data-country="US" data-flags="true" ></div>
尝试 data-name
/name
属性,例如:
<div class="bfh-selectbox bfh-countries col-md-3" data-name="Attribute" data-country="US" data-flags="true" ></div>
您好,我使用来自 bootstrap 的国家 select 表单助手,但是如何将其与模型绑定? 通常我使用
@Html.TextAreaFor(m => m.Attribute, new { @class = "form-control col-md-2", required = "required" })
但这里我只有 div,我想将 select 国家/地区列表中的数据传递给模型,但不知道如何。谁能帮帮我?
<div class="bfh-selectbox bfh-countries col-md-3" data-country="US" data-flags="true" ></div>
尝试 data-name
/name
属性,例如:
<div class="bfh-selectbox bfh-countries col-md-3" data-name="Attribute" data-country="US" data-flags="true" ></div>