Joe
Member
- Joined
- Jun 22, 2022
- Messages
- 7
- Programming Experience
- 3-5
Hi, how would you achieve this using Datatables server side i.e. how would you add the 'Edit' link and display the correct date format?
I hope this make sense.
I hope this make sense.
C#:
@foreach (var d in Model.Account)
{
<tr>
<td>@d.UserID</td>
<td>
@d.AccountEmailAddress
</td>
@if (@d.DateAccountCreated != null)
{
<td>@d.DateAccountCreated.Value.ToString("dd/MM/yyyy hh:mm:ss tt")</td>
}
else
{
<td>@d.DateAccountCreated</td>
}
<td class="text-center">
@if (d.AccountApproved.HasValue && d.AccountApproved.Value == true)
{
<i class="fa fa-check" aria-hidden="true"></i>
}
else
{
<span class="text-color-red">
<i class="fa fa-times" aria-hidden="true"></i>
</span>
}
</td>
<td class="text-center">
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
<a class="buttonstyle" href='~/2424?UserId=@d.UserID'>Edit</a>
</td>
</tr>
}