During the civil war, were there any battles that took place within a city? Were soldiers trained in specific ways in which to fight when not in an open space that would allow for large unit maneuvers, or were urban environments avoided because of their being non-conducive to the prevailing infantry tactics of the time?
The Battle of Fredericksburg immediately comes to mind for me.
On Dec. 11, 1862, the Army of the Potomac attempted to cross the Rappahannock River on two pontoon bridges directly across from the town. (Another bridge was planned for a mile downstream.)
The engineers in charge of the pontoon operation came under sharp fire from a brigade of Mississippi soldiers under the command of William Barksdale. So effective was the Mississippians' fire that the pontoon engineers were forced to quit.
Gen. Ambrose Burnside, commander of the Union force, then unleashed his guns on Fredericksburg in an attempt to snuff out the Confederate resistance. For more than two hours, the 150 guns of Brigadier Gen. Henry Hunt's artillery pounded Fredericksburg.
After the bombardment, the bridge-building resumed ─ and so did the Confederate fire. Burnside then asked for volunteers to ride single pontoons across the river, ferrying Union units to the Confederate side in order to muster a force and push back the Mississippians.
While the men from Mississippi had been ordered to retreat, they instead stood their ground as men from Michigan and Massachusetts entered the city. A description of the battle can be found in the text of a National Park Service brochure that guides visitors through Fredericksburg.
Fredericksburg is probably the best example. Note that Robt E Lee wished to spare civilians from the brunt of war and he sometimes tried to avoid city fighting. This may be why he did not occupy Fredericksburg at the start of the 1864, although I've never been too sure of why the CSA was disposed the way they were that spring.
Gettysburg also some fighting as the union troops retreated pell-mell through the city. One general, I think Barlow was hiding in some alley way or something I dimly recall. Only one civilian was killed that battle, Jennie Wade who was apparently baking bread when some stray bullet hit her. Its hard to imagine someone baking bread in the middle of the greatest battle in American history.
Antietam MD must have seen some fighting at least very close to the city limits. Take a look at the action on the southern end of the battlefield, it comes very close to the city.
Also Charleston SC and Vicksburg MI some a lot of artillery shells enter the cities. I think Vizetelly drew a scene of a civilian being hit by sharpnel in Vicksburg. I dont think there was any fighting in the streets though. Knoxville, TN saw a siege as did Suffolk VA and Yorktown. So did larger cities like: Atlanta, Richmond/Petersburg and Mobile but not sure how close the siege lines got to the city streets I dont recall any fighting in the streets.
I dont think soldiers were trained at all in urban fighting. In fact I think most southern generals wanted to avoid fighting in the cities.