Groups | Blog | Home
all groups > asp.net > may 2005 >

asp.net : ASP.NET 2 Beta 2 JavaScript bad rendering


Alejandro Penate-Diaz
5/23/2005 11:46:21 PM
Hi. I was handling key events nicely using some Javascript on my apps using
something like this:
this.txtUserName.Attributes.Add("onkeydown","if((event.which && event.which
== 13)||(event.keyCode && event.keyCode ==
13)){document.Form1.cmdLogin.click();return false;}else return true;");

that code rendered javascript to the client OK. Now that I upgraded to
ASP.NET 2 Beta 2 it is rendering && instead of &&, so clients are
getting this instead:

if((event.which && event.which == 13)||(event.keyCode &&
event.keyCode == 13)){document.Form1.cmdLogin.click();return false;}else
return true;

Please HELP!!

Thanks,

Alejandro Penate-Diaz.

Brock Allen
5/24/2005 8:51:03 AM
Can you show how you render the script to the client? IOW, do you use Page.ClientScriptRegisterClientScriptBlock
or something else?

-Brock
DevelopMentor
http://staff.develop.com/ballen



[quoted text, click to view]


Alex D.
5/24/2005 1:17:26 PM
using something like this in my Page_Load method.:

this.txtUserName.Attributes.Add("onkeydown","if((event.which &&event.which
== 13)||(event.keyCode && event.keyCode
==13)){document.Form1.cmdLogin.click();return false;}else return true;");




[quoted text, click to view]

Alex D.
5/24/2005 2:03:00 PM
do you think this would work?
<system.web>
<!-- other elements here -->
<XHTML11Conformance
enableObsoleteRendering="true" />
</system.web>




[quoted text, click to view]

Alex D.
5/24/2005 2:07:08 PM
that didnt work, when I build the app I get an error like:
Error 1 Unrecognized configuration section XHTML11Conformance.
c:\inetpub\wwwroot\qman\Web.config 9




[quoted text, click to view]

Brock Allen
5/26/2005 9:17:37 AM
Well, I see the &amp; that it's rendering, but the code executes properly.
Does your javascript work?

-Brock
DevelopMentor
http://staff.develop.com/ballen



[quoted text, click to view]


Alejandro Penate-Diaz
5/26/2005 6:23:42 PM
It doesn't work


[quoted text, click to view]

AddThis Social Bookmark Button