Hi Usharani,
If something is working fine in local and it is not working in production or any other environment first you have to check the configurations of the both the environments if the both environment set ups are same then you only you have to check the coding part.
To know the exact error where it's gets failed then you have to write logs then only we come to know what is the issue. First you have to implement the logging then check where it's gets struck, why it is not prompting login popup and why it is redirecting to custom error page in IIS.
Hope this helps you...
--------------------------------------------------------------------------------
Give respect to your work, Instead of trying to impress your boss.
N@veen
Blog : http://naveens-dotnet.blogspot.in/