title: asp ModalPopupExtender is getting closed when page is getting postback
body: <p>I am using asp ModalPopupExtender to display a treeview in asp.net page. When I click a button a ModalPopupExtender will be raised and loads the treeview with checkbox( loading treeview is a usercontrol ascx). In that usercontrol I have written some server side code for when I check a parent node all the child nodes should be checked. Fot this my page will get postback. My problem is when my page gets post back my ModalPopupExtender is getting off and on and my functions are working fine.</p>
  
  <p>here is my treeview in ascx page </p>
  
  <pre><code> &lt;asp:TreeView ID="tvFolderSelect" runat="server" RootNodeStyle-ForeColor="Black"
      CssClass="foldertree" LeafNodeStyle-ForeColor="Black" LeafNodeStyle-Font-Bold="false"
      ParentNodeStyle-ForeColor="Black" Width="100%" Style="margin: 3px 0 0 -16px;"
      OnTreeNodePopulate="tvFolderSelect_TreeNodePopulate" OnTreeNodeCheckChanged="tvFolderSelect_TreeNodeCheckChanged" onclick="postbackOnCheck(event);"
      ShowCheckBoxes="All" &gt;
    &lt;LeafNodeStyle Font-Bold="False" ForeColor="Black" CssClass="foldertreeleafnode"
          ImageUrl="~/images/img_dms/sm_fldr.png"  /&gt;
      &lt;ParentNodeStyle Font-Italic="True" ImageUrl="~/images/img_dms/sm_fldr.png" Font-Underline="True"
          CssClass="foldertreeparentnode"/&gt;
      &lt;NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="0px"
          NodeSpacing="0px" VerticalPadding="0px" /&gt;
      &lt;RootNodeStyle ForeColor="Black" CssClass="foldertreerootnode" /&gt;
      &lt;SelectedNodeStyle Font-Underline="False" HorizontalPadding="0px" VerticalPadding="0px" /&gt;
  &lt;/asp:TreeView&gt;
  </code></pre>
  
  <p>and here is the javascript function to get postback</p>
  
  <pre><code> function postbackOnCheck(e) {
      var evt = e || window.event;
      var o = evt.target || evt.srcElement;
      if (o.tagName == 'INPUT' &amp;&amp; o.type == 'checkbox' &amp;&amp; o.name != null &amp;&amp; o.name.indexOf('CheckBox') &gt; -1) {
         __doPostBack("", "");
      }
  }
  </code></pre>
  
  <p>Here is I am using the control</p>
  
  <pre><code>  &lt;img id="AddActivity" runat="server" src="../images/plus1.gif" alt="" style="text-align: right;
                                  cursor: pointer; float: right; padding: 1%;" /&gt;
                              &lt;asp:ModalPopupExtender ID="MPEACT" runat="server" TargetControlID="AddActivity"
                                  PopupControlID="ACTDiv" BackgroundCssClass="modalBackground" /&gt;
  </code></pre>
  
  <p>How can I stop getting invisibility of the ajax popup.</p>