Does the login control not work in IE (Internet Explorer 6 , 7 , any) and works fine in Firefox (1.0 , 2.0 , any )?
The problem always occurs after publishing, right?, not during development (unless you've incorporated Google AdSense in the development version also). The culprit is Google AdSense people.
A simple test : Use the visual studio comment toolbutton to comment out all the google scripts you've incorporated into your site, and check if login control works .....
I have created a custom user control that contains the javascript from google and am registering and using the usercontrol wherever i need the Advertisement. So i commented out all the Ad usercontrols i used in the login page AND the master page that login.aspx uses, so that in the final rendered version, google's scripts don't come with login control's rendered code at all. Now the login control works fine. Then i included Googles AdSense Scripts , uncommenting google script usercontrols and tried , the problem was back.
People think master pages are the reason login fails in IE-not-Firefox, but, no, the google ads mostly invariably placed in master pages are the real reason. Also not only does the login control cause problems in IE and not in Firefox, but also the LoginStatus control and a few other controls also cause problems in IE and not in Firefox. Some blogs & comments say authorization cookie is not picked up by the browser , i think that may be true , becoz google adsense scripts do some authentication cookie work themselves . The script downloaded from google by the stubs we put in our Aspx pages are probably the reason. I tried going through it , but could'nt make head or tail of it... way too complex for me.
Both the login & loginstatus controls work fine in firefox alonside google ads & scripts , though sometimes i see wierd behaviour ... if I clear all cookies & temp. internet files in firefox, the first time i click on the login button, nothing happens but a refresh. The second time i click it , it login fine.(All of this alongside google adscripts) . Justification :
- Google must have different scripts for IE and Firefox - which could be the reason IE can't perform correct while using ASP.NET 2.0 Login Controls , while firefox can.
- Or Login Control Library renders differently based on the browser (i don't know) the login page is often the first page requested by the client , in which case the asp runtime can see the user agent string and render accordingly....
- Google and ASP.NET may produce the same code for both browsers in which case , the browser architecture is responsible for this unique behaviour. (means Firefox is good!)
- Some folks think remember me check box - may be the cause, it defenitely could becoz it (leaves) involves a cookie, which i think is what(the cookies) google script wrecks !
- Most blogs and forums(especially in aspblog aspforum expertsexchange webdeveloper) say : Login control is suddenly broken - means it was working fine previously... they just don't connect the point of time the problem was discovered was always after a short or long time AFTER hooking up google ads ... for me i took i long time discovering the error after setting up google adsense , so it didnt occur to me adsense could be the change that causes the problem.
- We all use different kinds of AdSense units : so the problem also differs slightly : to some the pressing of login button does nothing but refresh the page, to me there was no reaction at all after i pressed the login button after entering correct & wrong pair of username and password , to some it seems there is redirect & error code 404 is returned once they click on the login button.
Best Workaround :
- Create another similar master page without the ads , and use this as master for login.aspx - you preserve the same look and feel, but forgo ads till Microsoft or Google comes up with a solution.
- Enclose all ads between <% if(!Page.title.equals("Login")){ %> and <%} %>, which means u've solved the Login Control , but still the LoginStatus and other login controls could still give you a problem.(make sure you title the login page to "Login")
- In case you are'nt using a master page at all for login.aspx , new login page without the ads , must be built.
Go Here for more Info :
http://www.thiagarajan.net/ZaszBlog/post/2008/05/Login-control-ASPNET-works-in-Firefox-but-not-in-IE.aspx