locked
LoginStatus not working in Firefox 2 or Opera 9... RRS feed

  • Question

  • User990340429 posted

    So I've got a fairly simple master page which has a LoginStatus control  which appears to render fine with the following code:

    <a id="ctl00_loggedInStatus" title="" class="AspNet-LoginStatus" href="javascript:__doPostBack('ctl00$loggedInStatus$ctl02','')">Login</a>
     When browsing with IE7 the onclick event fires and I'm redirected to my login.aspx page defined in my web.config.
    Unfortunately when I browse the page in Firefox or Opera nothing happens when I click on the link.
     I'm hoping it's just something small I've missed, but any help would be greatly appreciated.
    Just for context, the actual code in the master page is:  
    <asp:LoginStatus ID="loggedInStatus" runat="server" LogoutPageUrl="~/home.aspx" />
     , and the code in the Web.config is:   
    <authentication mode="Forms"><forms loginUrl="login.aspx" /></authentication>
     
    Friday, August 24, 2007 12:23 AM

All replies

  • User-534056067 posted

    I don't really understand why that is... but I can give you some data as a base of comparison...

    I visited this page in IE7, FF 2.0.0.6 and Opera 9.22 http://www.asp.net/cssadapters/membership/loginstatus.aspx. In all cases the HTML that is rendered for the login "button" is an anchor (A) tag just like what you show in your posting. And in all 3 browsers that anchor works correctly for me. That is, it causes me to be taken to the login page.

    Can you try that live page, too, and post your results? If it works, then I guess you need to try to see what you are doing differently in your site. If it doesn't work then I'd start looking at the options settings in FF and Opera to see if maybe you disabled JavaScript or set some other preference that is problematic.

    Sorry, I wish I had an immediate "answer" for you but we're going to need to do some diagnostic work together to get to the bottom of this.

    Thursday, September 6, 2007 11:26 AM
  • User990340429 posted

     Russ,

     Thanks for the response!

    If I create a new page and drop a LoginStatus control onto the Default.aspx page (no master page) and load it in Firefox, nothing appears to happen on click, and the Error Console gives me:

    __doPostBack is not defined  Line: 1

    javascript: __doPostBack('LoginStatus1$ctl02',")

    I can view the CssAdapters web site without problem, and I can load the CSS Adapters Sample project on my local machine without problem. I'm not sure if it has something to do with the way the code in the master pages and sample modules interact with the sample pages or what, but I just want to get this to work without trying to reengineer all that support code if possible. Thanks in advance for any help you can provide.
     

    Thursday, September 6, 2007 12:38 PM
  • User1618900539 posted

    Hi!

    Can you do a View Source of your rendered page under Firefox and / or Opera and see if you can find the following code??

    <script type="text/javascript">
    <!--
    var theForm = document.forms['aspnetForm'];
    if (!theForm) {
        theForm = document.aspnetForm;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    // -->
    </script> 

    For what you are saying, this bit seems to be missing, or, as Russ said, there could be a weird user setting in the browser thats breaking JavaScript. What happens if you do a clean install of any of the browsers?

     

    Cheers,

     Juan

    Friday, September 7, 2007 7:51 AM
  • User1045502397 posted

    I don't know if this is relevant to in this situation but I had the same situation show up in one of my pages. 

    The fix turned out to be very strange.  We had a <body> tag that was malformed ( was <body''> )  Once I fixed that tag, everything worked just fine.  Apparently that killed the DOM tree in FF?  Not sure why it would work in IE but not FF but that was the problem for me.

     Hopefully this helps someone save an afternoon of frustration!

     

    Wednesday, October 10, 2007 5:06 PM