title: Method Invoke() inside click event doesnt change controls values in Page
body: <p>We have a click Event that inside calls a previously set Action session variable. The problem is that the changes done in the click event shows fine in the page but the changes done inside the Action method called in the invoke doesn't get shown in the page...
  Debugging it seems like the Invoked method is in another context/viewstate for the page controls.</p>
  
  <p>Simplified code example:</p>
  
  <pre><code>public static Action OKFunction {
      get =&gt; (Action) HttpContext.Current.Session["OKFunction"];
      set =&gt; HttpContext.Current.Session["OKFunction"] = value;
  }
  
  protected void FunctionPrepareCall() {
      //in the long version we prepare a javascript dialog with _doPostback and set the desired target function depending on various conditions, here we show only the problematic part, setting the target function
      OKFunction = DialogDeleteItemAcepted;
  }
  
  protected void ConfirmationDialogOk_Click(object sender, EventArgs e) {
      lbMsg.Text = "TestConfirmDialog"; //this value is what it is shown after the page refreshes
      OKFunction ? .Invoke(); //calling the target function if its assigned
      string currentMsgValue = lbMsg.Text; //right here in debug the value of lbMsg.Text is the one we assigned in this method "TestConfirmDialog";
  }
  
  public void DialogDeleteItemAcepted() {
      //right here in debug the value of lbMsg.Text appears empty, like it would be in another thread context/viewstate
      lbMsg.Text = "TestDialogDeleteItemAcepted"; //in the real case the message text would depend on the result of the delete item operation for example
      //right here in debug the value of lbMsg.Text is the one we assigned "TestDialogDeleteItemAcepted";
  } 
  </code></pre>