0

我应该怎么做才能垂直呈现我的列表,我也希望文本出现在单选按钮的左侧

<div class="editor-label">
            @Html.LabelFor(m => m.HowDidYouHear, "سمعت عن الملتقى من خلال")
        </div>
        <div class="editor-field">
            @foreach (var opt in Model.HowDidYouHear)
            {          
                <label for="opt">@opt</label>

                @Html.RadioButtonFor(m => m.SelectedHowDidYouHear, opt, new { id = opt })
            }
        </div>
4

1 回答 1

0

只需添加一个内部 div。在 foreach 循环中

<div class="editor-label">
    @Html.LabelFor(m => m.HowDidYouHear, "سمعت عن الملتقى من خلال")
</div>
<div class="editor-field">
    @foreach (var opt in Model.HowDidYouHear)
    {          
        <div>
            <label for="opt">@opt</label>
            @Html.RadioButtonFor(m => m.SelectedHowDidYouHear, opt, new { id = opt })
        </div>
    }
</div>
于 2013-05-07T06:28:13.360 回答