Wednesday, March 21, 2012

A group of PostBackTrigger in my updatepanel

I use a repeater to print out information (hyperlinks) from my database. When you click a hyperlink I want to update a updatepanel.

The problem is that the controlID for each link must be typed in a PostBackTrigger to work perfectly. I can't add PostBackTriggers at run time? Any solutions?

Regards Gustav


Can't you set your updatepanel's mdoe="Always" ?
If I remove my triggers and set UpdateMode="Always" the updatepanel updates without Ajax.

The easiest maybe to handle the hyperlink click event on the server side, and update the desired updatepanel in the click event by the .Update() method.

For handling all hyperlink click event in single event in the server side, and determine which link was clicked: check msdn for handling events in repeater, this is a regular asp.net task not ajax. Search for: "How to: Respond to Button Events in DataList, Repeater, or GridView Items"

No comments:

Post a Comment