Firefox issue with ASPNET AJAX - DOTNET

This is a discussion on Firefox issue with ASPNET AJAX - DOTNET ; Hi, I am using ASP.NET AJAX to check username availability in a registration form. Everything works fine in IE but not in FF. Using Firebug, i can find the offending line but not sure what to about it. The error ...

+ Reply to Thread
Results 1 to 6 of 6

Firefox issue with ASPNET AJAX

  1. Default Firefox issue with ASPNET AJAX

    Hi,
    I am using ASP.NET AJAX to check username availability in a registration
    form. Everything works fine in IE but not in FF. Using Firebug, i can find
    the offending line but not sure what to about it. The error firebug gives
    txtUsername has no properties. Not sure how to fix this. Thank you for any
    help.

    var txtUserName;

    function pageLoad()

    {

    txtUserName = $get("<%=Username.UniqueID %>");

    }



    function CheckUserName()

    {

    if (txtUserName.value.length > 0)

    {

    $get("imgWaitingUsername").style.display = 'inline';

    $get("spanUsername").innerHTML = 'Checking Username Availability...';

    $get("spanUsername").style.color = "red";

    $get("spanUsername").style.fontWeight = "bold";

    PageMethods.CheckUserName(txtUserName.value, OnCheckUserName);


    }

    else

    $get("spanUsername").innerHTML= "";

    reqvalUsername.innerHTML = "Username is required";


    }




  2. Default Re: Firefox issue with ASPNET AJAX

    Hi,

    Showjumper wrote:
    > Hi,
    > I am using ASP.NET AJAX to check username availability in a registration
    > form. Everything works fine in IE but not in FF. Using Firebug, i can find
    > the offending line but not sure what to about it. The error firebug gives
    > txtUsername has no properties. Not sure how to fix this. Thank you for any
    > help.


    Which is the offending line?

    You have a missing '{' on the line indicated by "HERE" (see below).

    You should really start to indent your code and use a consistent code
    guideline, it would make your code easier to read and to debug.

    HTH,
    Laurent

    >
    > var txtUserName;
    >
    > function pageLoad()
    >
    > {
    >
    > txtUserName = $get("<%=Username.UniqueID %>");
    >
    > }
    >
    >
    >
    > function CheckUserName()
    >
    > {
    >
    > if (txtUserName.value.length > 0)
    >
    > {
    >
    > $get("imgWaitingUsername").style.display = 'inline';
    >
    > $get("spanUsername").innerHTML = 'Checking Username Availability...';
    >
    > $get("spanUsername").style.color = "red";
    >
    > $get("spanUsername").style.fontWeight = "bold";
    >
    > PageMethods.CheckUserName(txtUserName.value, OnCheckUserName);
    >
    >
    > }
    >
    > else


    HERE

    >
    > $get("spanUsername").innerHTML= "";
    >
    > reqvalUsername.innerHTML = "Username is required";
    >
    >
    > }
    >
    >
    >


    --
    Laurent Bugnion [MVP ASP.NET]
    Software engineering, Blog: http://www.galasoft.ch
    PhotoAlbum: http://www.galasoft.ch/pictures
    Support children in Calcutta: http://www.calcutta-espoir.ch

  3. Default Re: Firefox issue with ASPNET AJAX

    Error in Firebug is txtUserName has no properties. Offending line appears to
    be
    if (txtUserName.value.length > 0)
    Took care of the missing bracket and it still does not work in FF but works
    in IE.
    Also My code IS indented in VS.
    "Laurent Bugnion, MVP" <galasoft-lb@bluewin.ch> wrote in message
    news:e7$6SvZ1HHA.5644@TK2MSFTNGP05.phx.gbl...
    > Hi,
    >
    > Showjumper wrote:
    >> Hi,
    >> I am using ASP.NET AJAX to check username availability in a registration
    >> form. Everything works fine in IE but not in FF. Using Firebug, i can
    >> find the offending line but not sure what to about it. The error firebug
    >> gives txtUsername has no properties. Not sure how to fix this. Thank you
    >> for any help.

    >
    > Which is the offending line?
    >
    > You have a missing '{' on the line indicated by "HERE" (see below).
    >
    > You should really start to indent your code and use a consistent code
    > guideline, it would make your code easier to read and to debug.
    >
    > HTH,
    > Laurent
    >
    >>
    >> var txtUserName;
    >>
    >> function pageLoad()
    >>
    >> {
    >>
    >> txtUserName = $get("<%=Username.UniqueID %>");
    >>
    >> }
    >>
    >>
    >>
    >> function CheckUserName()
    >>
    >> {
    >>
    >> if (txtUserName.value.length > 0)
    >>
    >> {
    >>
    >> $get("imgWaitingUsername").style.display = 'inline';
    >>
    >> $get("spanUsername").innerHTML = 'Checking Username Availability...';
    >>
    >> $get("spanUsername").style.color = "red";
    >>
    >> $get("spanUsername").style.fontWeight = "bold";
    >>
    >> PageMethods.CheckUserName(txtUserName.value, OnCheckUserName);
    >>
    >>
    >> }
    >>
    >> else

    >
    > HERE
    >
    >>
    >> $get("spanUsername").innerHTML= "";
    >>
    >> reqvalUsername.innerHTML = "Username is required";
    >>
    >>
    >> }
    >>
    >>
    >>

    >
    > --
    > Laurent Bugnion [MVP ASP.NET]
    > Software engineering, Blog: http://www.galasoft.ch
    > PhotoAlbum: http://www.galasoft.ch/pictures
    > Support children in Calcutta: http://www.calcutta-espoir.ch




  4. Default Re: Firefox issue with ASPNET AJAX

    Hi,

    Showjumper wrote:
    > Error in Firebug is txtUserName has no properties. Offending line appears to
    > be
    > if (txtUserName.value.length > 0)


    That error means that the control named after "<%=Username.UniqueID %>"
    doesn't exist on your page. It's null, so when you try to access the
    "value" property, it throws an error.

    You must find why there is no such control on your produced page. Try to
    view the produced HTML source (on the web client) and see if it's here.

    > Took care of the missing bracket and it still does not work in FF but works
    > in IE.


    That's rather surprising for this error. Compare the produced HTML code
    in IE and in Firefox. Do you see differences?


    > Also My code IS indented in VS.


    OK, that's good. I use "Insert spaces" instead of "Keep tabs" in the
    "Text editor" options in VSto avoid this kind of annoyance when I
    copy/paste code.

    HTH,
    Laurent
    --
    Laurent Bugnion [MVP ASP.NET]
    Software engineering, Blog: http://www.galasoft.ch
    PhotoAlbum: http://www.galasoft.ch/pictures
    Support children in Calcutta: http://www.calcutta-espoir.ch

  5. Default Re: Firefox issue with ASPNET AJAX

    Fixed the issue: it was the Unique ID reference which worke din IE but not
    in FF.
    "Laurent Bugnion, MVP" <galasoft-lb@bluewin.ch> wrote in message
    news:OePfPLe1HHA.5772@TK2MSFTNGP02.phx.gbl...
    > Hi,
    >
    > Showjumper wrote:
    >> Error in Firebug is txtUserName has no properties. Offending line appears
    >> to be
    >> if (txtUserName.value.length > 0)

    >
    > That error means that the control named after "<%=Username.UniqueID %>"
    > doesn't exist on your page. It's null, so when you try to access the
    > "value" property, it throws an error.
    >
    > You must find why there is no such control on your produced page. Try to
    > view the produced HTML source (on the web client) and see if it's here.
    >
    >> Took care of the missing bracket and it still does not work in FF but
    >> works in IE.

    >
    > That's rather surprising for this error. Compare the produced HTML code in
    > IE and in Firefox. Do you see differences?
    >
    >
    >> Also My code IS indented in VS.

    >
    > OK, that's good. I use "Insert spaces" instead of "Keep tabs" in the "Text
    > editor" options in VSto avoid this kind of annoyance when I copy/paste
    > code.
    >
    > HTH,
    > Laurent
    > --
    > Laurent Bugnion [MVP ASP.NET]
    > Software engineering, Blog: http://www.galasoft.ch
    > PhotoAlbum: http://www.galasoft.ch/pictures
    > Support children in Calcutta: http://www.calcutta-espoir.ch




  6. Default Re: Firefox issue with ASPNET AJAX

    Thanks for your help.
    "Laurent Bugnion, MVP" <galasoft-lb@bluewin.ch> wrote in message
    news:OePfPLe1HHA.5772@TK2MSFTNGP02.phx.gbl...
    > Hi,
    >
    > Showjumper wrote:
    >> Error in Firebug is txtUserName has no properties. Offending line appears
    >> to be
    >> if (txtUserName.value.length > 0)

    >
    > That error means that the control named after "<%=Username.UniqueID %>"
    > doesn't exist on your page. It's null, so when you try to access the
    > "value" property, it throws an error.
    >
    > You must find why there is no such control on your produced page. Try to
    > view the produced HTML source (on the web client) and see if it's here.
    >
    >> Took care of the missing bracket and it still does not work in FF but
    >> works in IE.

    >
    > That's rather surprising for this error. Compare the produced HTML code in
    > IE and in Firefox. Do you see differences?
    >
    >
    >> Also My code IS indented in VS.

    >
    > OK, that's good. I use "Insert spaces" instead of "Keep tabs" in the "Text
    > editor" options in VSto avoid this kind of annoyance when I copy/paste
    > code.
    >
    > HTH,
    > Laurent
    > --
    > Laurent Bugnion [MVP ASP.NET]
    > Software engineering, Blog: http://www.galasoft.ch
    > PhotoAlbum: http://www.galasoft.ch/pictures
    > Support children in Calcutta: http://www.calcutta-espoir.ch




+ Reply to Thread

Similar Threads

  1. ajax - Consuming .net web services from FireFox
    By Application Development in forum DOTNET
    Replies: 1
    Last Post: 10-04-2007, 11:07 AM
  2. javascript or ajax problem with firefox
    By Application Development in forum Javascript
    Replies: 2
    Last Post: 10-01-2007, 04:07 AM
  3. Javascript, Firefox, InnerHTML and AJAX
    By Application Development in forum Javascript
    Replies: 6
    Last Post: 07-28-2007, 07:32 PM
  4. Ajax and PHP cookies in Firefox
    By Application Development in forum Javascript
    Replies: 0
    Last Post: 05-04-2007, 11:52 AM
  5. Float:left firefox issue && YUI calendar z-index issue.
    By Application Development in forum Javascript
    Replies: 0
    Last Post: 04-22-2007, 07:09 PM