Hello,
I had to do the same thing to fix the partialviewdemo. However, that and the book do not explain how the partialviewdemo action works.
The book just discusses this part
Code:
public ActionResult Message() {
ViewBag.Message = "This is a partial view.";
return PartialView();
}
It does not explain how that works with
Code:
public ActionResult PartialViewDemo() {
return View();
}
How does the partialViewDemo method know to use the actionResult Message? Couldn't it just as easily assume to use one of the others like Index2?
It really seems to me that partialViewDemo should return a blank view (with just the stuff from _Layout.cshtml) since there is no code in the method defining the ViewBag.Message or anything. Can someone explain this?