capture Multiple events in server controls

Discussion in 'ASP .Net Building Controls' started by @rturo, Aug 29, 2006.

  1. @rturo

    @rturo Guest

    Im try to build a control with multiple events rised by different elements
    but can't find any advanced example that can help me with this.

    In the case of GridView, it fires many events, one of those is
    SelectedIndexChaged and other is RowDeleted. when you look at the client
    script they produce "__doPostBack('GridView1','Select$[index]')" and
    "__doPostBack('GridView','Delete$[index]')"

    Is this something i need to create through RaisePostBackEvent to recognize
    the second argument? or is something already implemented in webcontrol class.

    All Microsoft examples only show the RaisePostBackEvent(string
    eventArgument) just with one event like OnClick and the stringArgument is not
    used, but what if a i want to work with many events in my control and what if
    they affect just one item of a collection.

    Please refer me to a good source where i can get advanced help on this matter.

    Thanks
    @rturo, Aug 29, 2006
    #1
    1. Advertising

  2. @rturo

    Teemu Keiski Guest

    Hi,

    yes you do check this via RaisePostBackEvent and there raise different
    events based on the string argument.

    Here is one article covering the aspects:
    http://www.code-magazine.com/articleprint.aspx?quickid=0511051&printmode=true


    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke



    "@rturo" <> wrote in message
    news:...
    > Im try to build a control with multiple events rised by different elements
    > but can't find any advanced example that can help me with this.
    >
    > In the case of GridView, it fires many events, one of those is
    > SelectedIndexChaged and other is RowDeleted. when you look at the client
    > script they produce "__doPostBack('GridView1','Select$[index]')" and
    > "__doPostBack('GridView','Delete$[index]')"
    >
    > Is this something i need to create through RaisePostBackEvent to recognize
    > the second argument? or is something already implemented in webcontrol
    > class.
    >
    > All Microsoft examples only show the RaisePostBackEvent(string
    > eventArgument) just with one event like OnClick and the stringArgument is
    > not
    > used, but what if a i want to work with many events in my control and what
    > if
    > they affect just one item of a collection.
    >
    > Please refer me to a good source where i can get advanced help on this
    > matter.
    >
    > Thanks
    Teemu Keiski, Aug 30, 2006
    #2
    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. Max
    Replies:
    7
    Views:
    9,104
  2. newbye
    Replies:
    0
    Views:
    580
    newbye
    Jul 6, 2006
  3. daniel kurtz

    Capture events on controls in template columns

    daniel kurtz, Oct 10, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    101
    Eliyahu Goldin
    Oct 11, 2005
  4. Justin

    How do I capture events fired in child user controls?

    Justin, Jan 27, 2004, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    235
    Justin
    Jan 27, 2004
  5. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    355
    Chris
    Aug 30, 2005
Loading...

Share This Page