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
  • 25,361
  • 10
  • 41
  • 58
Zapnologica
  • 21,164
  • 41
  • 147
  • 239

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
  • 461
  • 1
  • 6
  • 16