so i works in asp.net mvc 4 project and i have a problem in my view, what i want is create a view with 2 differnt type of model,first view (Index) take IEnumerable (Models.m
Create a new, compound view model that includes both of these view models.
public class CompoundViewModel
{
public IEnumerable AllSubscribers {get; set;}
public SubscribersModel SelectedSubscriber {get; set;}
}
Ideally also split your view into partial views and render these two part of your compound model into them using DisplayFor<> or EditorFor<>. That way you can reuse the view for a 'SubscriberModel' elsewhere in the application if you need it.
Your controller code could also be improved by using a dependency injection framework (e.g. Autofac) to inject those dependencies that you are currently newing up.
Another alternative, given that you are using the same model for the list and the details view, would be to handle this client-side using Javascript, either manually using jQuery or with one of the newer frameworks that allows client-side model binding like Knockout.js or Angular.js.