Making the white sauce or bechamel sauce: heat a medium-sized saucepan over medium heat and melt the butter. Add the flour and cook it until slightly golden. Whisk in the milk until no lumps remain.
Simmer the sauce until slightly thick and season with salt, pepper, mustard powder, and paprika. Remove from heat and mix in the cheddar cheese until melted. Set aside.
Line the bottom of the baking dish with half of the sliced potatoes.
Add half of the sliced onions on top of the potatoes.
Pour in half of the bechamel sauce evenly over the onions and potatoes.
Repeat the layers.
Finish with the grated parmesan cheese, cover loosely with foil and bake for 50 mins.
Remove the foil and bake for 10 more minutes or until melted and gooey.