You can try using PopupManager and display a modal pop up. I
created a very simple sample which will display a login box. When
user enters valid credentials the login window is removed. Please
check out the sample attached and see if that helps.
You can also try using view states, detailed in the URL
below, instead of displaying a pop up to the user.