title: Passing data into a ModalPopupExtender
body: <p>I have a ModalPopupExtender that allows a customer to apply payment info. It has been working great. Then the customer asked to see the total due on the ModalPopup. This did not seem like a big deal to just take the total due from the parent control and pass it into the ModalPopup control. It seems like there is no easy way do to this. </p>
  
  <p>Here is my HTML code, keep in mind this code is wrapped in a UpdatePanel</p>
  
  <pre><code>&lt;asp:LinkButton ID="lnkMakePayment" runat="server" Visible="true" OnClick="lnkMakePayment_Click" &gt;
  
  &lt;asp:Label ID="lblMakePayment" runat="server" Text="Make Payment"/&gt;&lt;/asp:LinkButton&gt;
  
  &lt;asp:Button ID="btnDummy" style="display: none;" runat="server" 
              OnClick="btnDummy_Click" /&gt;
  
  &lt;ajaxToolkit:ModalPopupExtender ID="mdlPopupPayment" runat="server" 
   TargetControlID="btnDummy" PopupControlID="pnlMakePayment"
   CancelControlID="popUpCancel" DropShadow="true" BackgroundCssClass="modalBackground"&gt;
  &lt;/ajaxToolkit:ModalPopupExtender&gt;
  
   &lt;asp:Panel ID="pnlMakePayment" runat="server" Style="display: none;"
              SkinID="PopUpPanel" class="ContentBoxColor" Width="400px" Height="170px"&gt;
      &lt;MP1:MakePaymentPopup ID="MakePayment"  runat="server" /&gt;
      &lt;div style="text-align: right; width: 100%; margin-top: 5px;"&gt;
         &lt;asp:Button ID="popUpCancel" runat="server" Text="Cancel" Width="0px" /&gt;
      &lt;/div&gt;
   &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>Now here is the codebehind</p>
  
  <pre><code>protected void btnDummy_Click(object sender, EventArgs e) { }
  
  protected void lnkMakePayment_Click(object sender, EventArgs e)
  {
      mdlPopupPayment.Show();
  } 
  </code></pre>
  
  <p>So when the user clicks the make payment link the ModalPopup works fine. And it even fires an event that the parent control listens for to apply payment info and all the associated payment details that the user fills out in the popup. Again this all works fine. </p>
  
  <p>My first attempt at sending the total due to the ModalPopup is as follows:</p>
  
  <pre><code>protected void lnkMakePayment_Click(object sender, EventArgs e)
  {
      // MakePayment is the actual ModalPopup control and total due is a public property
      MakePayment.TotalDue = txtTotalDue.Text
      mdlPopupPayment.Show();
  } 
  </code></pre>
  
  <p>The problem with this is that when I click the link to show the ModalPopup the PageLoad event does not fire so I have no way to assign my property to a label inside the ModalPopup.
  I even attempted to use the session object but had the same issue. 
  I can not even make a trip to the database because I can not pass in a customer ID. 
  Any ideas?
  I am a novice at Javascript and perfer a server side soultion but at this point I am willing to try anything. </p>
  
  <p>The MakePayment user control contains 3 asp textboxes. One for the user to input a payment amount, another for payment type, and a third for notes like check numbers. Also on the control there is an apply and cancel button. The parent control is a basic ascx page which is a data entry screen that contains the ModalPopupExtender and all html code to activate it. </p>