Monday, April 1, 2019

Pass Another Value from ViewBag or Other ino EditorFor

...
@if (d.fee1 > 0)

{

<div class="form-group">

@Html.LabelFor(model => model.fee1, htmlAttributes: new { @class = "control-label col-md-2" })

<div class="col-md-10">

    @Html.EditorFor(model => model.fee1, new { htmlAttributes = new { @class = "form-control",@Value=d.fee1 } })

    @Html.ValidationMessageFor(model => model.fee1, "", new { @class = "text-danger" })

</div>

</div>

}

@if (d.fee2 > 0)

{

<div class="form-group">

@Html.LabelFor(model => model.Fee2, htmlAttributes: new { @class = "control-label col-md-2" })

<div class="col-md-10">

    @Html.EditorFor(model => model.Fee2, new { htmlAttributes = new { @class = "form-control" ,@Value=d.fee2} })

    @Html.ValidationMessageFor(model => model.Fee2, "", new { @class = "text-danger" })

</div>

</div>

}

No comments:

Post a Comment

Linq Expression syntax for where condtion in linq

(Expression<Func<T, bool>> filter)