Preheat the oven to 350 degrees F (175 degrees C).
In a large bowl, stir together the sugar, flour, baking powder and salt. Cut in the butter or margarine until the lumps are no larger than peas. Stir in the egg just a little bit, but allow the mixture to stay somewhat crumbly.
Sprinkle half of the mixture in an even layer in the bottom of a 9x13 inch pan. Pack down into a solid crust. Spread the cranberry sauce over the crust. Crumble the remaining mixture over the cranberry sauce.
Bake for 40 minutes in the preheated oven, until the top is golden brown. Cool before slicing into bars.