dropdownlist onchange squiggly

G

Guest

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
 
P

Peter Bucher [MVP]

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:
 
G

Guest

this.dropTest.Attributes.Add("onchange", "foo(this.value);");
what's the best way to find all the possible client-side events for any
control?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top