473,778 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Attribute 'onchange' is not a valid attribute of element 'TextBox'

Hi!

Using:

<asp:TextBox ID="TextBox1" runat="server"
onchange="oncha nge()"></asp:TextBox>

I get:

Warning 1 Validation (ASP.Net): Attribute 'onchange' is not a valid
attribute of element 'TextBox'.

How to avoid this warning? What should I do to "fix" it?

Possibly you styles or like that???

Thanks

Joe
May 2 '07 #1
2 13307
"Joe Kovac" <Jo****@nospam. comwrote in message
news:6f******** *************** ***@news.inode. at...
Using:

<asp:TextBox ID="TextBox1" runat="server"
onchange="oncha nge()"></asp:TextBox>

I get:

Warning 1 Validation (ASP.Net): Attribute 'onchange' is not a valid
attribute of element 'TextBox'.
That's because you're using a webcontrol, which doesn't have an onchange
method.
How to avoid this warning? What should I do to "fix" it?
In code-behind:

TextBox1.Attrib utes.Add("oncha nge", "onchange() ;");

Also, see my previous message advising against this... :-)

--
http://www.markrae.net

May 2 '07 #2
Mark Rae wrote:
"Joe Kovac" <Jo****@nospam. comwrote in message
news:6f******** *************** ***@news.inode. at...
>Using:

<asp:TextBox ID="TextBox1" runat="server"
onchange="onch ange()"></asp:TextBox>

I get:

Warning 1 Validation (ASP.Net): Attribute 'onchange' is not a valid
attribute of element 'TextBox'.

That's because you're using a webcontrol, which doesn't have an onchange
method.
>How to avoid this warning? What should I do to "fix" it?

In code-behind:

TextBox1.Attrib utes.Add("oncha nge", "onchange() ;");
I guess this way MS wants to point out clearly, that you use non MS
properties. Putting it to the .aspx page works, but produces a not
beautiful warning.

Also, see my previous message advising against this... :-)
See my comment on your comment of your previous message ;-)
May 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4425
by: KenLee | last post by:
I use asp.net 2.0. I try to use onblur in textbox of asp.net. however, it said that validation(asp.net):attribution onblur is not a valid attribute of element 'textbox' what casuse this problem?
5
2133
by: emma_middlebrook | last post by:
Hi I've found the rules that cover what is a valid attribute name here: http://www.w3.org/TR/2006/REC-xml-20060816/ 2.3 Common Syntactic Constructs Is there anything already in the dotnet framework which I can use to test whether a string can be a valid attribute name or do I have to roll my own implementation?
4
2697
by: Mark | last post by:
Hi, I am trying to port an application for ASP.NET 1.1 to ASP.NET 2.0. Why am I getting "Error 1 Validation (Internet Explorer 6): Attribute 'ms_2d_layout' is not a valid attribute of element 'table'" from this element "<TABLE height="689" cellSpacing="0" cellPadding="0" width="1109" border="0" ms_2d_layout="TRUE">"? How do I fix this error? -- Thanks, Mark
1
7774
by: perspolis | last post by:
Hi all I created a Web Project but it dosen't support some properties of HTML tags and it gives me following error: Attribute 'height' is not a valid attribute of element 'table' I don't know why?/ thanks in advance
1
1895
by: fiefie.niles | last post by:
I converted my VS2003 ASP.Net project to VS2005. I use frame in VS2003 with no problem like the following: <frame name="banner" scrolling="no" noresize target="contents" src="SPTop.htm"> In VS2005 it gave me the error: Validation (Internet Explorer 6): Attribute 'target' is not a valid attributeof element 'frame' How can I fix this problem ? Thank you.
0
2991
by: Tom Chi | last post by:
Hi, I am porting an ASP.NET Javascript/C# application from .NET framework 1.x (everything works there) to 2.0 on Windows Server 2003 SP1, and experieced problem (null reference) while trying to raise a custom event ("DisplayMessageRequested"). The web page exposes the event in a user control hosted in Internet Explorer 6.0. The Javascript event handler uses Microsoft specific 'for and 'event' syntax as shown below: <script...
2
2361
by: Dan | last post by:
Hi, i want to use character '<' and '>' (without quotes) as text in the listitem of a dropdownlist in the aspx file. <asp:ListItem Text="< or =" Value="2"></asp:ListItem> there is no error, except in the aspx file: Visual Web Dev changes the color "attribute or is not a valid attribute od element ListItem" Any way to do that?
5
2910
by: =?Utf-8?B?bXBhaW5l?= | last post by:
So this one is confusing as everything works but I want this warning to go away. This is what I have (within a .NET 2.0 Web Application, using VS.NET 2008 SP1): default.aspx: <%@ Page Language="C#" OnLoadComplete="Page_LoadComplete" %> <%@ Import Namespace="System" %> <%@ Import Namespace="System.Web" %> <script runat="server">
5
4170
by: rote | last post by:
I have a webpart project i copied across and after setting up in VS 2005 all good. When i go to the design mode and try and autofornat my webpartzone to for example Simple or Professional. The i try and view it to Design mode i get error saying it can't be switched and then when i complile it i get these errors below !!! arg.. Attribute 'width' is considered outdated. A newer construct is recommended. Attribute 'Title' is not a valid...
0
10302
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10136
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7478
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.