ASP.NET 2 Beta 2 JavaScript bad rendering

  • Thread starter Alejandro Penate-Diaz
  • Start date
A

Alejandro Penate-Diaz

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.
 
B

Brock Allen

Can you show how you render the script to the client? IOW, do you use Page.ClientScriptRegisterClientScriptBlock
or something else?
 
A

Alex D.

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

Alex D.

do you think this would work?
<system.web>
<!-- other elements here -->
<XHTML11Conformance
enableObsoleteRendering="true" />
</system.web>
 
A

Alex D.

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
 
B

Brock Allen

Well, I see the &amp; that it's rendering, but the code executes properly.
Does your javascript work?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,829
Latest member
KimberAlli

Latest Threads

Top