Here is the problem. I get IEnumerable from ViewPage, and when I tried to convert List, it shows me an error:
' System.Collections.Generic.IEnumerable<Pax_Detail> ' does not contain a definition for 'ToList' and no extension method 'ToList' that takes the first argument of the type ' System.Collections.Generic.IEnumerable<Pax_Detail> ' can be found (you are missing a directive using or assembly references?)
Here is my controller code:
[HttpPost] public ActionResult Edit_Booking(Booking model, IEnumerable<Pax_Detail> pax) { List<Pax_Detail> paxList = new List<Pax_Detail>(); paxList = pax.ToList();
I applied the same logic to another controller. And it works fine. I do not know what's the problem. I already cleaned, rebuilt the project, and also restarted my laptop (although it was necessary).
c # asp.net-mvc-3
Dhwani Apr 04 '13 at 13:37
source share