Control Events renamed in ASPX - What a shame

M

Mikeon

Hello!

Today it came to me that ASP.NET has a special "feature" that takes an
event name defined on a control and adds the "On" prefix for it when it
is used in the ASPX file ie.: when you use the Button control, to wire
up the Click event you have to use the OnClick event.
Now that is a shame! Why ASP.NET changes the names of my events and
only in ASPX file (in the code behind the same event is named
correctly)?
I can see only problems that result from this one of the most obvious
is that it is not possible to define a client side "onclick" event for
the button, because ASP.NET already uses this name for my Click (!!!)
event.

Is there at least one GOOD reason why ASP.NET does what it does in a
way it is doing it?
 
B

Bruce Barker

the orignal design of asp.net was to avoid client code, and to match winform
syntax thru abstract controls. now that ajax has made client code popular
again, this is somewhat an issue. the next release will have ajax aware
controls that makes linking client script less messy.

-- bruce (sqlwork.com)
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top