DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 2 Aug 2007 18:38:10 -0400,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Showjumper nlsdkfja
          2    Laurent Bugnion, MVP
          3    Showjumper nlsdkfja
                 4    Laurent Bugnion, MVP
                        5    Showjumper nlsdkfja
                        6    Showjumper nlsdkfja


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


}
Date:Thu, 2 Aug 2007 18:38:10 -0400   Author:  

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
Date:Fri, 03 Aug 2007 08:59:22 +0200   Author:  

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"  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 
Date:Fri, 3 Aug 2007 08:53:51 -0400   Author:  

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
Date:Fri, 03 Aug 2007 17:27:29 +0200   Author:  

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"  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 
Date:Fri, 3 Aug 2007 18:04:06 -0400   Author:  

Re: Firefox issue with ASPNET AJAX   
Thanks for your help.
"Laurent Bugnion, MVP"  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 
Date:Fri, 3 Aug 2007 18:19:08 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us