In Mode-View-Controller, it is the controllers responsibility to hand the correct model down to the view, depending on the action you are calling. With that in mind. You don't want to create a global list with your BidModel.
Since you are using MVC 3 you can pass it down to the View quite nicely using the dynamic property ViewBag.
Consider this:
public ActionResult RetreiveAllBids()
{
var bids = BidRepository.GetAllBids();
ViewBag.Bids = bids.ToArray();
return View();
}
You could of course use LINQ-to-* depending on what your ORM / Data Storage is. But this might get you an idea on how to pass the List down to the View.
Edit
I Miss-read your question a little bit, but I still think the above is valid, but depending on how you want your data to be accessable and when you want to dispose it, you have two options:
- Static variable that lives during the whole life-cycle of your web application
- Session variable that lives with the current user
And you might only want these accessable from certain sites, maybe you want to break those functions out and put them in a parent class, where you store the BidModel list like this:
public IEnumerable<BidModel> Bids
{
get { return Session["Bids"] as IEnumerable<BidModel>; }
set { Session["Bids"] = value; }
}
This way you can just derive from this parent class on the controllers that needs the functionality to add / list / remove or whatever you like to do with the bidders.