views:

25

answers:

1

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.

A: 

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>
joerage
Is there a way I can use my own tags so that I just specify the ID. The the buttons will be on various locations throughout the page.
leaf dev
Then, instead of using asp:Button, declare you own class, called it Button or whatever, and add property called ID. When you use it, you will need to reference that class in your aspx and then use it such as this: <mytag:Button ID="btnOne" />
joerage