Preheat oven to 375 Butter a 1-quart casserole dish.
Layer 1/2 of the potatoes into bottom of prepared dish, top with 1/2 of the onion slices, season with chili powder, salt and pepper to taste. Layer remaining potatoes and onions on top. Season with chili powder, salt and pepper to taste.
In a medium saucepan, melt butter over medium heat, mix in the flour and salt. Stir constantly with a whisk for 1 minute. Stir in milk, cook until mixture has thickened. Stir in cheese all at once, continue stirring until melted, about 30 to 60 seconds. Pour cheese mixture over the potatoes. Cover the baking dish with aluminum foil.
Bake for 1 hour, remove foil, bake an additional 10 to 15 minute.