I'm not an expert either (though 18th/19th century warfare is one of my favourite subjects) but want to comment on this question, too.
For us it seems rather unlikely that the soldiers in those times stupidly marched towards the enemy, enforcing the shootout like in some prominent movies (
http://www.youtube.com/watch?v=HUFTcrbRyEM&feature=player_detailpage#t=56s).
But I think there were no real alternatives to these tactics. As [ptx] wrote, the flintlock muskets of these times were inaccurate like hell; if you wanted to get a certain number of hits, you had to fire a lot of them at the same time and the only way to mass enough muskets on one spot was to form those lines we all know from the movies.
Another reason is what I want to call the spirit of the time. I cannot comment on all armies of that time as I mainly have sources about the Frederickan army but the infantry in those times formed lines three ranks deep with the tallest (and thus most impressing) men in the front rank. In case suddenly the whole line had to face about, it was unthinkable the the single men within the line simply turned around. No, the whole formation had to wheel around 180 degrees. The gentlemen officiers of those times who were so fond of good order surely wouldn'T have tolerated that their men lie to the ground seeking for cover.
Last but not least, keeping your men together in massed formations was the easiest way to control them and to avoid desertions in the heat of battle in a time when not patriotism made the men fight but rather fear of the own officers and NCOs.
So I would say yes, they really marched forward while getting shot.