asp.net ajax - How to always trigger an Asynchronous PostBack for an UpdatePanel from a Button in a DataList? -


I have a dateste in which there is a collection of people, each person has a button to click on Required is an inelegant postback, so the OnClick event handler can change the details shown in an update panel [DataAllist is out of UpdatePanel].

I have made two attempts to set the button to change the update panel in the data destination of the on-system databound event handler. Assigns an AsyncPostBackTrigger to an UpdatePanel and both of which were in the registered Azzinnor PostBox control script manager, but only for the first time if the second person's button [or second time a single button] is pressed then the page is posted completely is.

UpdatePanel's UpdateMode is set to conditional and the script manager is set to EnablePartialRenderingEnablePartialRendering true.

Code in OnItemDataBound:

  button btnShowNotes = e item. FundControl ("BTNshonets") in the form of buttons; // trigger AsyncPostBackTrigger trigger = new AsyncPostBackTrigger (); Trigger. Control id = btn Shawnotes. UNICID; Trigger.EventName = "click"; Disbursement Trigger. Add (trigger); // UpdatePanel // Trigger or it is used, ScriptManager1 is not both. Registrar Async Postback Control (btnShowNotes);  

Once the ASCNC postback has happened, it seems that the context is lost, but of course it can be continuously released without rebooting the datalist? The way I am trying it, I must remember something in it.

I came up with a solution I'm not sure that this is the best / most optimal one Page_Load method On each postback, I login to Anime Postback on the Loop and Button via Item:

{foreach (DataListItem item in gvAllUsers.Items) {btnShowNotes = item .FindControl ("BtnShowNotes") as ImageButton; ScriptManager1.RegisterAsyncPostBackControl (btnShowNotes); }}

Comments