N
Nathan Sokalski
I add a JavaScript event handler to some of my Webcontrols using the
Attributes.Add() method as follows:
Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"
TextBox2.Attributes.Add("onKeyPress", jscode)
You will notice that jscode contains the JavaScript Logical And operator
(&&). However, ASP.NET renders this as && in the code that is
output, even though it is intended to be client-side JavaScript, not a
visible onscreen character. How can I get ASP.NET to output
onKeyPress="return (event.keyCode>=65&&event.keyCode<=90);"
instead of
onKeyPress="return (event.keyCode>=65&&event.keyCode<=90);"
I am using VB.NET to write my server-side code, and am using Visual Studio
..NET 2003 with .NET 1.1. Thanks in advance for any help you can give.
Attributes.Add() method as follows:
Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"
TextBox2.Attributes.Add("onKeyPress", jscode)
You will notice that jscode contains the JavaScript Logical And operator
(&&). However, ASP.NET renders this as && in the code that is
output, even though it is intended to be client-side JavaScript, not a
visible onscreen character. How can I get ASP.NET to output
onKeyPress="return (event.keyCode>=65&&event.keyCode<=90);"
instead of
onKeyPress="return (event.keyCode>=65&&event.keyCode<=90);"
I am using VB.NET to write my server-side code, and am using Visual Studio
..NET 2003 with .NET 1.1. Thanks in advance for any help you can give.