In a large bowl, mix together the garlic powder, smoked paprika, salt, onion powder, and black pepper.
Pat the legs dry with paper towels and place them into the bowl with the seasoning mixture.
Pat the seasoning all over the legs, give it a shake, and then pat some more seasoning onto the legs. You want to get them really coated.
Refrigerate the bowl with the legs for 30 minutes.
While those are in the refrigerator, preheat your oven to 400°F with a rack in the center position.
Line a rimmed baking sheet with foil and place the wire rack on top of the foil.
Remove the chicken legs from the refrigerator and gently place them on the wire rack. Let stand for about 10 minutes to get to room temperature.
Bake the legs at 400 degrees for 35 minutes.
Reduce the oven temperature to 350°F.
Remove the baking sheet from the oven and brush the top of the chicken legs with barbecue sauce.
Return the legs to the oven and bake for 7 to 10 minutes.
Remove the baking sheet from the oven. Turn the legs over and brush with the BBQ sauce. Put them back in the oven and continue baking for another 7 to 10 minutes.