Control Events renamed in ASPX - What a shame

Discussion in 'ASP .Net' started by Mikeon, Mar 15, 2006.

  1. Mikeon

    Mikeon Guest

    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?

    --
    Michal
    Mikeon, Mar 15, 2006
    #1
    1. Advertising

  2. Mikeon

    Bruce Barker Guest

    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)


    "Mikeon" <> wrote in message
    news:...
    > 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?
    >
    > --
    > Michal
    >
    Bruce Barker, Mar 15, 2006
    #2
    1. Advertising

  3. Mikeon

    Joey Guest

    Joey, Mar 16, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruce W...1

    Can a .aspx file be renamed to .htm?

    Bruce W...1, Aug 23, 2003, in forum: ASP .Net
    Replies:
    11
    Views:
    657
    MS News \(MS ILM\)
    Aug 24, 2003
  2. Brent White
    Replies:
    4
    Views:
    2,278
    Brent
    Oct 28, 2005
  3. Shame on Tucows!

    , Aug 11, 2006, in forum: HTML
    Replies:
    23
    Views:
    4,446
    Big Bill
    Aug 13, 2006
  4. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    337
    Chris
    Aug 30, 2005
  5. fir

    alignment shame (?)

    fir, Nov 30, 2012, in forum: C Programming
    Replies:
    14
    Views:
    344
Loading...

Share This Page