Custom Ajax Extender - Collection Property

117 views Asked by At

I have written a custom ajax extender for use with ASP panels and JQuery dialogs. The problem I face is that I need multiple buttons to trigger the dialog, therefore attributes aren't really a viable option. I am hoping to do something like the following:

<ex:DialogExtender TargetID="pnlSomePanel">
   <triggers>
      <button ID="btnOne">
      <button ID="btnTwo">
   </triggers>
</ex:DialogExtender>

Does anyone know how I can add this custom "triggers" collection into my extender? Thanks.

1

There are 1 answers

2
joerage On

In your extender, you add a property like the following:

private List<Button> triggers;
public List<Button> Triggers
{
    get { return triggers; }
    set { triggers = value; }
}

And you will be able to use it like this:

<ex:DialogExtender TargetID="pnlSomePanel">   
    <Triggers>      
        <asp:Button ID="btnOne">      
        <asp:Button ID="btnTwo">   
    </Triggers>
</ex:DialogExtender>