If you execute the code carefully in the debugger or use a request analyzer like Fiddler, you will realize that the script manager control requires http://localhost:3261/WebApp/atlasglob.axd which it cannot access until user is logged in.
The solution is to add the following in web.config so that atlasglob.axd can be retrieved when the user is not logged in.
<location path="atlasglob.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>