473,327 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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";
}

Aug 2 '07 #1
5 1360
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
Aug 3 '07 #2
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" <ga*********@bluewin.chwrote in message
news:e7**************@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

Aug 3 '07 #3
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
Aug 3 '07 #4
Fixed the issue: it was the Unique ID reference which worke din IE but not
in FF.
"Laurent Bugnion, MVP" <ga*********@bluewin.chwrote in message
news:Oe**************@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

Aug 3 '07 #5
Thanks for your help.
"Laurent Bugnion, MVP" <ga*********@bluewin.chwrote in message
news:Oe**************@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

Aug 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mark Olbert | last post by:
The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an autopostback checkbox, for that matter). I'm aware of a problem with Netscape browsers and the...
1
by: Gerald Stampfel | last post by:
Hi, i am doing ajax requests to an IIS server. the response is a JSON string, stored in xml.responseText. in IE everything is fine. in firefox, only a part (80%) of the string is delievered in 8...
4
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole...
4
by: ext237 | last post by:
Simple ajax call seems to have some issues in Firefox. The "onComplete:" is called BEFORE the response is returned by the call. Is there a coding issue or a work around? var ajax = new...
2
by: germ | last post by:
doing a simple page webmethod call an a page via PageMethods works fine in ie7 & opera9 the same call on firefox ( and I assume netscape ) generates the following error : Error: " nsresult:...
0
by: jrnail23 | last post by:
I have a user control which contains an UpdatePanel, which contains a MultiView inside, with a GridView in one of the views. In my GridView, I have a ButtonField which is supposed to trigger a...
6
by: raknin | last post by:
I am creating a dynamic list on the server using php file,when I run the PHP script in all 4 browsers (IE 6, Firefox 2, opera and safari 3) every think go Ok and the list is created. but when I call...
3
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a...
13
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.