mvc models dates comparison.

Feb 6 2018 4:05 AM
here i want to compare both models dates if date is equal i want to create button if date is not equal i want to create label(dates should be unique no duplications)
 
hi guys here i have two models
 
@foreach (var dat2 in Model.differences1)
{
Itemin sfdsf = new Itemin(); ////////o/p 02/06/2018
02/07/2018
sfdsf.show_dates = dat2;
<button class="btn btn-primary">@Html.Raw(@dat2)</button>
@*<span>Date :</span>@dat.dates<<br />*@
}
@foreach (var dat3 in Model.presentda)
{
Itemin sfdsf = new Itemin();
sfdsf.show_dates = dat3;
<button class="btn btn-success">@Html.Raw(@dat3)</button>
@*<span>Date :</span>@dat.dates<<br />*@
}
 
o/p
02/06/2018
02/07/2018
02/08/2018
02/09/2018
2/10/2018
 
i need o/p:
02/06/2018 02/07/2018 02/08/2018 02/09/2018 2/10/2018
 
first two are buttons and remaining three are labels.

Answers (4)