on ipad 3 there is a special button for that, it's located above the volume buttons on the upper right side of the ipad. it lock and unlock the auto rotation.
and on iphone 4 & 4s u have to click the home button twice then go left till u find on the very left side a touch button to lock and...