MVC依赖下拉列表

时间:2017-12-29 09:35:13

标签: javascript asp.net asp.net-mvc

Create.cshtml

<div class="form-group">
        @Html.LabelFor(model => model.MCategoryId, "Üst Kategori Adı", htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.DropDownList("MCategoryId", null,"Kategori Seçiniz", htmlAttributes: new { id = "category1" })
            @Html.ValidationMessageFor(model => model.MCategoryId, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.SubCategoryId, "Sub Kategori Adı", htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.DropDownList("SubCategoryId", null, htmlAttributes: new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.SubCategoryId, "", new { @class = "text-danger" })
        </div>
    </div>

您好,当我点击该类别时,我想打开子类别。像这样。 http://jsfiddle.net/v917ycp6/5/

0 个答案:

没有答案