Autofocuisng of AF NIKKOR 50mm f/1.8D not working in D90?

Yesterday I bought a brand new AF NIKKOR 50mm f/1.8D. After inserting the lens into the camera body and when rotated in anti-clockwise direction to lock the lens, I can't hear the "click" sound. While I'm inserting my 18-105mm kit lens and rotating in anti-clockwise direction, I can hear a "click" sound saying lens is locked. But While I'm doing the same procedure with 50mm lens, I can't hear this sound. I'm able to shoot in camera manual mode [M] with manual focus. But I'm unable to do auto-focusing. I set the camera body to AF [The knob in the side].
And When I'm setting the camera to any mode like Aperture Priority /Shutter Priority mode, "F--" symbol is showing up in LCD. This lens will work in manual mode only.
Please help.
Regards,
MLg
Added (1). I'm able to find the lock tab. Can you please explain why we need to lock at f/22. I'm keeping the lens mounting point with the same as camera mounting point while inserting the lens.

You need 2 lock the aperture to f/22.
If you can't find the lock tab, read the manual that came w/ the lens. It's clearly marked on the diagram.

You need to lock the lens at the smallest aperture (BEFORE its mounted) to allow the camera to correctly control the aperture (rather than the lens) and other functions.
All the old Nikkor AF D lenses need to be locked int this way - they will autofocus on any camera with an inbuilt focus motor in the body (that includes your D90, but doesn't include the entry level models for which you have to manually focus this lens).

Nikon's D lenses have aperture rings for backwards compatibility with older camera bodies. You need to set the aperture to f/22 so your D90 can control the lens' aperture outside of Manual mode. If it's not set to f/22, the camera body won't communicate with the lens the way it needs to. Using the minimum aperture lock isn't absolutely necessary, but it does ensure that you won't bump the ring out of position while you're shooting.
I don't think your problem has to do with the aperture ring, though. I have a D90 and the 50mm f/1.8D lens, and that error message is what I get when the lens isn't mounting properly or the contacts are a bit dirty. My 50mm feels like it fits more snugly against the camera body than any of my other lenses do, and it takes a little more effort than the others to turn it to the point where it clicks. Are you able to gently turn it a bit more and make it click into place?