Disposable aluminum foil pans make a convenient carrier for bringing a cake to a potluck or party because you don't have to worry about packing it up and taking it home again. They also make cleanup easier when you host a child's birthday party. The curved corners on a square or rectangular aluminum foil pan present the most significant difference from a standard glass or metal baking pan. This shape may alter how you want to decorate the cake.
Preheat the oven to the temperature given in the recipe, based on the size pan you are using.
Apply a coat of butter to the interior surface of the pan. Pay extra attention to the corners. Aluminum pans have slight creases and folds, especially in the corners. Apply extra butter to the corners, to ensure you can remove the cake easily. You may use cooking spray in place of butter, if you prefer.
Scoop 2 or 3 tablespoons of flour into the pan. Turn the pan to its sides at different angles to move the flour until it adheres to the butter all over the pan interior. You want butter and flour coating any part of the pan the batter touches.
Bake the cake according to the directions in the recipe. Check the cake during the last 10 minutes of prescribed baking time by inserting a toothpick into the center of the cake. When the toothpick comes out without wet batter on it, take the cake out of the oven
Allow the cake to cool to room temperature.
Run a knife around the edge of the pan. Turn the pan upside down to remove the cake. If the cake sticks in the pan, you can cut the pan with kitchen shears to get the cake out. Cut each corner of the pan and fold down the sides to remove the cake.