Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In View @foreach loop not working it shows error!!! #9

Open
AmitRathod07 opened this issue Mar 29, 2023 · 3 comments
Open

In View @foreach loop not working it shows error!!! #9

AmitRathod07 opened this issue Mar 29, 2023 · 3 comments

Comments

@AmitRathod07
Copy link

Screenshot 2023-03-29 163043

    <table>
        <thead>
            <tr>
                <th>@Html.DisplayNameFor(model => model.ProfilePictureURL)</th>
                <th>@Html.DisplayNameFor(model => model.FullName)</th>
                <th>@Html.DisplayNameFor(model => model.Bio)</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            **@foreach (var item in Model)**
            {
                <tr>
                    <td class="align-middle">
                        <img class="rounded-circle" src="@item.ProfilePictureURL" alt="@item.FullName" style="max-width: 150px" />
                    </td>
                    <td class="align-middle">
                        @Html.DisplayFor(modelItem => item.FullName)
                    </td>
                    <td class="align-middle">
                        @Html.DisplayFor(modelItem => item.Bio)
                    </td>
                    <td class="align-middle">
                        <a class="btn btn-outline-primary"><i class="bi bi-pencil-square"></i>Edit </a> |
                        <a class="btn btn-outline-info"><i class="bi bi-eye"></i>Details </a> |
                        <a class="btn btn-danger text-white"><i class="bi bi-trash"></i>Delete </a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
@saikodari
Copy link

@AmitRathod07 may be the model your retrieving from controller is null

@Yogesh0775
Copy link

return view(data); on Actors Controller

@dwarwick
Copy link

Maybe data is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants