Whatever works.
For a while, I was doing most of the really low-speed technical climbing sections with my butt on the saddle. It helped me maintain traction. There are a couple problems with that approach, though - sometimes I'd loop out on really steep bits, and it was hard to move further forward over the bike once I was committed. And, it was hard for me to help the bike up and over a ledge.
Lately, I'm climbing out of the saddle more. It's actually more about higher-speed situations. I washed out my front wheel the other day and realized I'd gotten into a bad habit of pulling back on the bars when applying power in climbs. This messes with my weight distribution, and I realized it had also been making it harder for me to hold a line, say over a root bed or something. When it gets really steep, I can maintain better weight distribution by getting out of the saddle, just a little bit, and moving forward over the bike. The above poster mentions a "short stand" - I think I've stumbled into about the same idea. It's very different from the tall, hips-forward stand I'll sometimes do when I want to stretch my legs and maybe need to put some power down but traction and handling aren't really a problem.