Does the call invoke the delegate defined by the signature (for example) of the Func <t, t> type synchronously explicitly in ASP.NET?
At the first examination it seems that this is so. A quick analysis of the call stack shows that the method passed to the delegate is executing as you would expect. But....
When a delegate is called in the "click" event and trying to change controls (for example, visibility, binding, updating update panels), nothing happens (in fact, to explicitly call UpdatePanel.Update, an exception is raised saying that the method cannot be called after Render - in every sense and purpose, although Im, obviously, NOT at this stage of the page’s life cycle, but rather in a control event — it is invariably handled as a postback event, always before Render, to my best knowledge.).
However ... When I return to the call site and execute the same code (immediately after the delegate was called) that I tried to execute (from the method called by the delegate) in order to influence the changes on various controls, it works.
What could be?
EDIT Framework code:
IModalWorkflowItem { void ExecuteWorkflow(); ..... } public abstract class BaseModalWorkflow : IModalWorkflowItem { .... protected Func<String, IMinervaValidator , Boolean>_action; .... /// <summary> /// Using the properties (if necessary) perform the action /// required on completion of modal workflow /// </summary> /// <returns></returns>; protected abstract Boolean PerformAction(PropertyBag properties); } Creating an object passing in lambda as an anonymous method ...
new ModalWorkflowUserGroupAction(ModalPopupExtender_UserPrompt, Session, (x, y) => { if (UserGroupManager.UserAccessToUserGroup(membershipID, CurrentUserGroup.UserGroupID, false)) { BindUserList(); Actual call:
/// <summary> /// Call the next action in the modal workflow. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ExpandingButton_ModalConfirmContinue_Click (Object sender, EventArgs e) { if (CurrentModalWorkFlowItem != null) { CurrentModalWorkFlowItem.ExecuteWorkflow();