Home Alone (1990)
Category:1990 films
Category:1990s comedy films
Category:American comedy films
Category:American films
Category:American remakes of British films
Category:American buddy films
Category:American film remakes
Category:Home invasion films
Category:Films directed by John Hughes
Category:Films set in Massachusetts
Category:Films set in New York City
Category:Films shot in California
Category:Films shot in New York City
Category:American Christmas films
Category:Christmas comedy films
Category:Films produced by John Hughes (filmmaker)
Category:Films scored by Lalo Schifrin
Category:Films with screenplays by John Hughes (filmmaker)
Category:Films scored by Danny ElfmanQ:
What does the int in asp.net MVC mean?
this is my first time using asp.net MVC and I'm not very clear on a few concepts. The concept of ViewBag is something I don't understand at all. What is the difference between ViewBag.CustomerId and @ViewBag.CustomerId? Can someone explain this concept?
A:
This is simply the names that have been defined for the ViewBag properties. The Html.DisplayNameFor() helper also has similar functionality to the ViewBag.
The ViewBag is a dictionary of properties that get passed to the view.
If you wanted to pass a list of customers to the view, you could do the following:
public ActionResult Customers(IEnumerable customers) {
ViewBag.Customers = customers;
return View();
}
And in the view you could then do the following:
@foreach (var customer in ViewBag.Customers) {
@Html.DisplayNameFor(m => customer)
}
If you wanted to pass only a single customer, you could do something like this:
public ActionResult Customers(Customer customer) {
ViewBag.Customer = customer;
return View();
}
And in the view you could then do the following:
@Html.DisplayNameFor(m => customer) ac619d1d87
Related links:
Komentarai