riverameadow
New Member
I'm learning ASP.NET MVC4, this in my first experience in Web development.I'm dealing with a situation. In one of my controllers, I'm returning a \[code\]IEnumerable<BaseClass>\[/code\] to a View.\[code\]public class TestController : Controller{ public ActionResult Index() { return View(Models); } // this static method is just for demo static List<BaseModel> Models() { ... }}\[/code\]Imagine now, that we have 6 concrete class in BaseModels.\[code\]public class ConcreteModel1 : BaseModel { .. } // Must show view1public class ConcreteModel2 : BaseModel { .. } // Must show view2public class ConcreteModel3 : BaseModel { .. } // and so on..public class ConcreteModel4 : BaseModel { .. }public class ConcreteModel5 : BaseModel { .. }public class ConcreteModel6 : BaseModel { .. }\[/code\]When I want to display the data, each \[code\]ConcrenteModel\[/code\] has its own \[code\]View\[/code\]. As it's shown in the below image.
How can I accomplish this? If I wasn't very clear, please let me knowThanks.