Tuesday, June 18, 2019

Pass Checked Unchecked in checkbox mvc razor

1. Pass Checked Unchecked in checkbox in mvc razor
    or Pass Checked Unchecked in checkbox in mvc
    or Pass Checked Unchecked in checkbox in razor


<tbody>
    @for (int i = 0; i < dl.Count; i++)
    {
        <tr>
            <td>@(i + 1)<input type="hidden" name="forms_list[@(i)].formid" value="@fl[i].formid"></td>
            <td>@dl[i].form_name </td>
            <td><input type="checkbox" name="forms_list[@(i)].view_" value="true" @(dl[i].view_ == true ? "checked" : "unchecked")></td>
            <td><input type="checkbox" name="forms_list[@(i)].add_" value="true" @(dl[i].add_ == true ? "checked" : "unchecked") ></td>
            <td><input type="checkbox" name="forms_list[@(i)].edit_" value="true" @(dl[i].edit_ == true ? "checked" : "unchecked") ></td>
            <td><input type="checkbox" name="forms_list[@(i)].del_" value="true" @(dl[i].del_ == true ? "checked" : "unchecked") ></td>
        </tr>
    }
</tbody>

1. Pass disabled in mvc razor

<div class="col-1">
    <div class="form-group mb-3">
        <div class="custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input" id="Feb" name="Feb" checked="@Model.Feb" value="true" @(Model.Feb == true ? "disabled" : "")>
            <label class="custom-control-label" for="Feb">Feb</label>
        </div>
    </div>
</div>
<div class="col-1">
    <div class="form-group mb-3">
        <div class="custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input" id="Mar" name="Mar" checked="@Model.Mar" @(Model.Mar == true ? "disabled" : "") value="true">
            <label class="custom-control-label" for="Mar">Mar</label>
        </div>
    </div>
</div>

No comments:

Post a Comment

Convert 1.25x speed spent hours convert into normal (1x) speed spent hours

If I run a video with 1.25x or 125% speed till 1 hour 26 minuts, then normal hours will be ?   1 hours 26 minuts convert into hours Total 60...