Normally short climbs i stand up and in a high gear go for it. For longer climbs i sit and spin and i may stand for short periods. On very steep long climbs like on i did in italy where i had no idea how steep it was going to be until i got to the climb i stand up and grind as my suffolk gearing was a little too tall. I could have chnaged it but That would have cost money.
Ultimatleh there is no right and wrong way. If you get up without having to walk you have done in a right way.
Same applies to riding off road but the bumpier the terrian the more i stand aslo i never spin off road it is alway a low cadance effort under 60 mOstly.