2

I am receiving a weird error message when i try and use @Html.Action() in my view?

here is the view code:

@Html.Action("Index", "Clients")

And here is the controller:

public class ClientsController : Controller
{
    private ROUTING_DBV6Entities db = new ROUTING_DBV6Entities();

    // GET: Clients
    public async Task<ActionResult> Index()
    {
        return View(await db.Clients.ToListAsync());
    }
}

And here is the error message which I have recieved:

{Cannot evaluate expression because the current thread is in a stack overflow state.}
pavel
  • 26,538
  • 10
  • 45
  • 61
Zapnologica
  • 22,170
  • 44
  • 158
  • 253

1 Answers1

1

Are you calling this from _Layout.cshtml?

try returning a partial view - return PartialView(await db.Clients.ToListAsync());

or add this to the clients view @{ Layout = null; }

Libin M
  • 481
  • 1
  • 6
  • 16