capture Multiple events in server controls

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default capture Multiple events in server controls

    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 Guest

  2. Similar Questions and Discussions

    1. Custom web control - Unable to capture events with AddHandler in an ITemplate
      Ok, I know this has been asked a lot. And I see a lot on the topic, but things are a little different here and it's still not quite working for...
    2. Controls events not firing
      Hi, I created a Main.aspx that contains a custom control, as follows: <body> <Sigma:pagebody id="pdbTemplate" runat="server"...
    3. Nesting server controls with a composite control don't generate postback events
      Hi, I am new to web controls so please forgive me if my terminology is not 100%! I am attempting to develop a composite control, based heavily...
    4. Handling Events in Nested Controls
      Hi, I have nested User Controls like below. User_Control_1 User_Control_11 User_Control_12(contains method DisplayMessage) ...
  3. #2

    Default Re: capture Multiple events in server controls

    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:
    [url]http://www.code-magazine.com/articleprint.aspx?quickid=0511051&printmode=true[/url]


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



    "@rturo" <rturo@discussions.microsoft.com> wrote in message
    news:F67E8879-A9A2-4EBE-9654-F317884B01BD@microsoft.com...
    > 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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139