title: Modal Pop Up Extender and Update Panels
body: <p>The ModalPopUpExtender makes a reference to "hiddenTargetControlForModalPopup" - this is a hidden button on the UI and it does not seem to be used anywhere except in the code shown below. </p>
  
  <p>The target for the modal pop up is the PANEL pnlNew, then why is the TagetControlID assigned to ID="hiddenTargetControlForModalPopup"? Just trying to understand this wiring...thanks!</p>
  
  <p>The  CancelControlID="btHiddenOK"  is not used anywhere on the modal pop up control (there is a separate cancel button on the modal pop (please see the SAVE and the CANCEL button in the update panel right below the comment ..LOT OF CODE.....so i tried to remove the attribute CancelControlID="btHiddenOK" - which resulted in the modal pop up being disabled? I was wondering that if the btHiddenOK is not even used on the modal pop up - removing it should not have any effect, but that does not appear to be the case? </p>
  
  <pre><code> &lt;asp:Button runat="server" ID="hiddenTargetControlForModalPopup" style="display:none"/&gt;
  
       &lt;asp:Panel ID="pnlNew" 
                     runat="server"               
                     DefaultButton="hiddenTargetControlForModalPopup"
                     style="width: 575px;"&gt;                  
                 &lt;!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--&gt;    
                 &lt;div class="shadowAreaBig" &gt;  
                        &lt;asp:UpdatePanel runat="server" ID="ModalPopupControls" UpdateMode="Conditional"&gt; 
                              &lt;ContentTemplate&gt;                                   
                               &lt;div class="shadowContainer  shadowContainerNew" &gt;
  
  
  
                                  &lt;!--    LOT OF CODE       --&gt; 
  
  
  
  
     &lt;div class="buttonsNew"&gt;
                              &lt;span class="buttonSave"&gt;
                                  &lt;asp:ImageButton AlternateText="Create new user" ID="ImageButton1" runat="server" ImageUrl="~/css/images/buttonSave2.png" OnClick="btOK_Click" OnClientClick="javascript:return validateControls();" TabIndex="110" style='display: none;' /&gt; 
                                  &lt;img style="border-width:0px;cursor: default;" alt="Create new user" src="../css/images/buttonSave2_disabled.png" tabindex="110" id="ImageButton1_Disabled" &gt;
                              &lt;/span&gt;
                              &lt;span class="buttonCancel"/&gt;
                                  &lt;asp:ImageButton AlternateText="Cancel" ID="ImageButton2" runat="server" CausesValidation="False" ImageUrl="~/css/images/buttonCancel.png" OnClientClick="cancel();return false;" TabIndex="111"/&gt;     
                              &lt;/span&gt;
                             &lt;/div&gt;    
  
  
                                &lt;/div&gt;
                              &lt;/ContentTemplate&gt;
                          &lt;/asp:UpdatePanel&gt;                   
                 &lt;/div&gt; 
                               &lt;!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--&gt;      
              &lt;p class="clearFloat"&gt;&lt;/p&gt;       
          &lt;/asp:Panel&gt;
          &lt;/div&gt;   
  
          &lt;cc1:ModalPopupExtender          
              ID="CreateMPExtender" 
              runat="server"         
              TargetControlID="hiddenTargetControlForModalPopup"
              PopupControlID="pnlNew"
              BackgroundCssClass="modalBackground"
              DropShadow="false" 
              BehaviorID="ModalPopupBehavior"       
              OkControlID="btHiddenOK"
              OnOkScript="ok()"
              OnCancelScript="hideModalPopup()"      
              RepositionMode="RepositionOnWindowResizeAndScroll"
              PopupDragHandleControlID="pnlNewSRO"
              CancelControlID="btHiddenOK"       
              /&gt;  
  
            &lt;asp:Button ID="btHiddenOK" runat="server" Style="visibility:none" /&gt;
  </code></pre>