@Html.RadioButtonFor boolean

Ive bekam ein Formular:

@using (Html.BeginForm("Buy", "Keys", FormMethod.Post))
{
<div class="calc_steps">
    <div class="NumberedRow one">
        1.  @Html.DropDownListFor(model => model.PaymentSystem, Model.PaymentSystems, new { @class = "calcsteps_select styledselect" })
    </div>
    <div class="NumberedRow two">
        2. <div class="cnt">
            Укажите тип лицензии
            <div class="radio-jquery-ui">@Html.RadioButtonFor(model => model.IsElite, "false") <label>Обычная</label></div>
            <div class="radio-jquery-ui">@Html.RadioButtonFor(model => model.IsElite, "true") <label>Расширенная</label></div>
           </div>
    </div>
    <div class="NumberedRow three">
        3.
        <div class="cnt">
             Введите срок
            @Html.TextBoxFor(model => model.NumDays)
        </div>
    </div>
    <div class="itog">
        Итого: <span id="ïtogo">0 рублей 00 копеек</span>
    </div>
    <div>
        <input type="submit" value="Купить"/>
    </div>
</div>
}

Modell:

public class BuyModel
{
    public string PaymentSystem;
    public bool IsElite;
    public int NumDays;
    public IEnumerable<SelectListItem> PaymentSystems;
}

Handlung:

    [HttpPost]
    public ActionResult Buy(BuyModel model)
    {
        return View("BuySummary", model);
    }

Und wenn ich es abschicken das Modell.IsElite, ist immer falsch(wie standardmäßig). Was mache ich hier falsch?

sieht perfekt aus. dass immer sux. Ich vermute, es ist in Ordnung, aber teilen Sie Ihre Modell-und action-Methode.
Ich habe meinen Beitrag aktualisiert. Vielen Dank für Ihre Zeit!
Sollten Sie binden, um die Eigenschaften der Variablen nicht

InformationsquelleAutor CodeDemen | 2013-03-08

Schreibe einen Kommentar