Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dropdownlist onchange squiggly

0 views
Skip to first unread message

rodchar

unread,
Oct 11, 2007, 10:49:00 AM10/11/07
to
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

Peter Bucher [MVP]

unread,
Oct 11, 2007, 11:03:33 AM10/11/07
to
Hello rodchar

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


rodchar

unread,
Oct 11, 2007, 11:42:00 AM10/11/07
to
> 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]

unread,
Oct 11, 2007, 2:06:27 PM10/11/07
to
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/sprache/eventhandler.htm#onchange

rodchar

unread,
Oct 11, 2007, 3:08:16 PM10/11/07
to
Thanks Peter, I appreciate the dialog which helped.
rod.
0 new messages