Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting Attributes.Add onkeypress to work on Mozilla Fir
Message
 
 
To
21/04/2008 22:20:42
General information
Forum:
ASP.NET
Category:
Web forms
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01312286
Message ID:
01312441
Views:
15
>I am using this code to add an onkeypress attribute to a textbox control on a form:
>
>
>        loControlTextboxUsername.Attributes.Add("onkeypress", "return FormLoginFromInput(event)")
>
>
>However, on Mozilla Firefox, the attribute does not get added. So, this means .NET is smart enough to detect the browser and ignore that line. Or, is there something I am missing?
>
>And, if that is the case, then, what kind of approach should I use to make sure this will be added on all browsers or how to have it compliant with all browsers?

Are you sure the method is called OnKeyPress? I don't recall exactly, but AFAIK it's something else like OnKeyCode... (Don't have this book with me right now).
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform