tap
tap

Reputation: 553

trying to get item count for a model MVC

@if (Model.DonationDetail != null)
{
   @Model.DonationDetail.recipient.Count();
}

Is returning

Compiler Error Message: CS1501: No overload for method 'Write' takes 0 arguments

what is the best way to display a count of these items in recipient?

thanks

Upvotes: 0

Views: 8930

Answers (1)

Rion Williams
Rion Williams

Reputation: 76597

Give this a try:

<text> @Html.Encode(Model.DonationDetail.Recipient.Count()) </text>

Upvotes: 2

Related Questions