How difficult is it to figure out how dinosaurs raised their children? Well, consider this: until the 1920's, scientists weren't even sure if all dinosaurs laid eggs (like modern reptiles and birds) or gave birth to live young (like mammals). Thanks to some spectacular dinosaur egg discoveries, we now know the former was the case, but the evidence for child-rearing behavior is more elusive--consisting mainly of tangled skeletons, preserved nesting grounds, and analogies with the behavior of modern reptiles, birds and mammals.
One thing is clear, though: different kinds of dinosaurs had different child-rearing regimens. Just as the babies of modern prey animals like zebras and gazelles are born with the ability to walk and run (so they can escape from predators), one would reasonably expect that sauropod eggs yielded "ready-to-run" hatchlings. And just as modern birds feed their newborns in specially prepared nests, at least some dinosaurs must have done the same--not high up in trees, necessarily, but in clearly marked-out birthing grounds.
In practical terms, the main difference between viviparous and oviparous animals is that the former can only give birth to a limited number of live newborns (one at a time for large animals like elephants, seven or eight at a time for small animals like cats), while the latter can potentially lay dozens of eggs in a single sitting. A female Seismosaurus probably laid 20 or 30 eggs at a time (despite what you may think, the eggs of sauropods weren't any bigger than bowling balls, and usually significantly smaller).
Why did dinosaurs lay so many eggs? As a general rule, any given animal will only produce as many young as are necessary to assure that a handful of them reach adulthood (and produce young themselves). The gruesome fact is that out of a clutch of 20 or 30 newly hatched Stegosaurus babies, only two or three would have escaped being immediately gobbled up by swarming tyrannosaurs and raptors--enough to ensure the perpetuation of the Stegosaurus line. (Just as many modern reptiles, including turtles, leave their eggs unattended, it's a good bet that many dinosaurs did too.)
Maiasaura, the Good Mother Lizard
For decades, paleontologists assumed that all dinosaurs employed this drop-your-eggs-and-run strategy, and that all newly hatched dinosaur babies were left to survive (or die) in a hostile environment. That all changed in the 1970's, when the famous fossil-hunter Jack Horner discovered the immense nesting grounds of a duck-billed dinosaur he named Maiasaura (Greek for "good mother lizard.") Each of the hundreds of Maisaura females on these grounds laid 30 or 40 eggs in circular clutches; and Egg Mountain (as this site in Montana is now known) has yielded fossils not only of eggs, but of hatchlings, juveniles, and adults as well.
Finding all these Maiasaura individuals tangled together, in different stages of development, was tantalizing enough. Further analysis of the fossils showed that newly hatched Maiasaura babies possessed immature leg muscles (and thus were probably incapable of walking, much less running), and their teeth had evidence of wear. What this implies was that adult Maiasaura brought food back to the nest and cared for their hatchlings until they were old enough to fend for themselves--the first clear evidence for dinosaur child-rearing. We now have evidence of similar parenting behavior Psittacosaurus, an early, relatively small ceratopsian, as well as for another hadrosaur, Hypacrosaurus.
However, one shouldn't conclude that all herbivorous dinosaurs fed and cared for their hatchlings. Sauropods, for example, expressly did not look after their young, for the simple reason that a twelve-inch-long, newborn Apatosaurus could easily have been crushed by the lumbering feet of its own mother! In these circumstances, a newborn sauropod would stand a better chance of survival on its own--even as its siblings were picked off by hungry theropods (of whose own child-rearing habits we know virtually nothing).
How Avian and Marine Reptiles Raised their Young
Ironically, the ancient reptiles most similar behaviorally to modern birds--pterosaurs--are a black hole when it comes to evidence of child-rearing. To date, only a handful of fossilized pterosaur eggs have been discovered, the first as recently as 2004, hardly a large enough sample to draw any inferences about parental care. The current state of thinking, based on analysis of fossilized pterosaur juveniles, is that chicks emerged from their eggs "fully cooked" and required little or no parental attention. There are also hints that some pterosaurs may have buried their eggs rather than incubating them inside their bodies, though the evidence is far from conclusive.
The real surprise comes when we turn to the marine reptiles that populated the lakes, rivers and oceans of the Mesozoic Era. Based on compelling evidence (such as tiny embryos fossilized inside the bodies of their mothers), paleontologists believe that most, if not all, ichthyosaurs gave birth to live young rather than laying eggs--the first, and as far as we know only, reptiles ever to have done so. As with pterosaurs, the evidence for later marine reptiles like plesiosaurs and pliosaurs is pretty much nonexistent; some of these sleek predators may well have been viviparous, but they may also have returned to land seasonally to lay their eggs.