Vimal Patel
Vimal Patel

Reputation: 3055

view with IEnumerable of object type in MVC4

I am new to MVC. While working with MVC4 application. I am getting following errors in view(see screenshot for details). I have following code in controller action method.

public ActionResult ShowData()
{
      IEnumerable<object> data = AccountMaster.GetAccountsInfo(); ;
      return View(data);
}

and in my view

@Model IEnumerable<dynamic>
@{
       ViewBag.Title = "ShowData";
       WebGrid grid=new WebGrid(Model);
}

<h2>ShowData</h2>

View Error

as you can see I am getting this error in view. Can somebody please help me with this?

Upvotes: 0

Views: 844

Answers (1)

Kishan Gupta
Kishan Gupta

Reputation: 626

Please write @Model in small case @model

@model IEnumerable<dynamic>

I hope it will solve your issue.

Upvotes: 1

Related Questions