473,408 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

dropdownlist onchange squiggly

hey all,

<asp:DropDownList id="DropDownList1" runat="server" onchange="Test();">

can someone please tell me why the onchange has a squiggly and if there is a
better way to access the client-side change event for the drop-down list?

The message is saying it's not a valid attribute of the drop down list
element but yet it still works for me?

thanks,
rodchar
Oct 11 '07 #1
4 2564
Hello rodchar
<asp:DropDownList id="DropDownList1" runat="server" onchange="Test();">

can someone please tell me why the onchange has a squiggly and if there is
a
better way to access the client-side change event for the drop-down list?
The message is saying it's not a valid attribute of the drop down list
element but yet it still works for me?
Yes, you catch this message, but looked to the rendered code too?
The point is:
All attributes where not available in the control, throw such a message.
But ASP.NET do render all that attributes AS-IS to the Html Code.
In this point, this is not a fail in any case, but rather a possible
improvement for a future version of Visual Studio :-)

Another way to add "custom" attributes to your control is wrote them in your
codebeside like:
---------
this.dropTest.Attributes.Add("onchange", "foo(this.value);");
---------

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Oct 11 '07 #2
this.dropTest.Attributes.Add("onchange", "foo(this.value);");
what's the best way to find all the possible client-side events for any
control?

"Peter Bucher [MVP]" wrote:
Hello rodchar
<asp:DropDownList id="DropDownList1" runat="server" onchange="Test();">

can someone please tell me why the onchange has a squiggly and if there is
a
better way to access the client-side change event for the drop-down list?
The message is saying it's not a valid attribute of the drop down list
element but yet it still works for me?
Yes, you catch this message, but looked to the rendered code too?
The point is:
All attributes where not available in the control, throw such a message.
But ASP.NET do render all that attributes AS-IS to the Html Code.
In this point, this is not a fail in any case, but rather a possible
improvement for a future version of Visual Studio :-)

Another way to add "custom" attributes to your control is wrote them in your
codebeside like:
---------
this.dropTest.Attributes.Add("onchange", "foo(this.value);");
---------

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Oct 11 '07 #3
Hello rodchar
what's the best way to find all the possible client-side events for any
control?
surfing around :-)
- http://de.selfhtml.org/javascript/sp...r.htm#onchange

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Oct 11 '07 #4
Thanks Peter, I appreciate the dialog which helped.
rod.

"Peter Bucher [MVP]" wrote:
Hello rodchar
what's the best way to find all the possible client-side events for any
control?
surfing around :-)
- http://de.selfhtml.org/javascript/sp...r.htm#onchange

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Oct 11 '07 #5

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

Similar topics

5
by: Bob N | last post by:
I have an ASP.NET web page -- several auto-post back DropDownLists that perform a query against a relatively large database (3 to 4 seconds delay) that repopulate a couple of datagrids, comboboxes...
1
by: chongo | last post by:
Hi, I'm a newbie to asp.net. Actually i'm working on my first page now. I have a drop list <asp:DropDownList id="menu" AutoPostBack="True" OnSelectedIndexChanged="onChange" runat="server"> ...
7
by: Daniel | last post by:
Is there any other way can override this event, like javascript onchange added to the attribute of this dropdownlist? Thanks
6
by: Julius Fenata | last post by:
Dear all, I have created client-side scripting to trigger event onChange from code-behind, like this: DropDownList1.Attributes = "GenerateArticleID()"; At the script on Windows Form, I...
5
by: robert | last post by:
I have a dropdownlist with the autopostback set to true. I want the user to be confirm whether they do indeed want to change the value, which on post back fires a server side event...
3
by: =?Utf-8?B?RGVlcGE=?= | last post by:
Hi All, I have a webform in asp.net framework 1.1 where the dropdownlist is populated with list of locations from the database. The depending on the list selected, the user will be able to see...
3
by: John Kotuby | last post by:
Hi all... I am trying to do a simple thing and maybe am missing something elementary. I have created a Javascript function at the top of a page which is meant to enable editing of an HTML input...
11
by: harold.gimenez | last post by:
Hi group, I am trying to change the selection of an ASP Dropdownlist just like "Orange" is selected here: http://www.w3schools.com/js/tryit.asp?filename=try_dom_option_selected The...
3
by: =?Utf-8?B?Y21lZWsxXzE5OTk=?= | last post by:
Hello, On a webpage, create an UpdatePanel with two DropDownLists. Set AutoPostBack of DropDownList1 to true. In the SelectedIndexChanged method, refill DropDownList2 and set the focus to...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.