Modalpopup extender dropdownlist problem

Mar 19 2009 8:08 AM

Usercontrol.ascx
<cc1:ModalPopupExtender BehaviorID="mdlSelectAll" ID="mdlSelectAll" runat="server"    TargetControlID="pnlSelectAll" PopupControlID="pnlSelectAll" BackgroundCssClass="modalBackground"    OnCancelScript="fnHideModalPopup('mdlSelectAll')" OkControlID="btnOk"  CancelControlID="btnClose" />
<asp:Panel ID="pnlSelectAll" runat="server" BackColor="White" Height="100px" Width="400px"    Style="display: none">   
  <asp:UpdatePanel ID="upAlerts" UpdateMode="Conditional"                runat="server">          
      <ContentTemplate>   
<table cellpadding="0" id="tblSelectAll" cellspacing="0" border="0" style="width: 100%">    
    <tr>     
       <td colspan="2" style="width: 100%" valign="top" align="center">   
        <asp:DropDownList runat="server" ID="comboTest">                    <asp:ListItem Text="a" Value=""></asp:ListItem>                    <asp:ListItem Text="b" Value=""></asp:ListItem>                    <asp:ListItem Text="c" Value=""></asp:ListItem>                </asp:DropDownList>           
</td>
</tr>        
<tr>
<td style="width: 193px">  
&nbsp;
</td>       
</tr>    
<tr>     
 <td  style="width: 193px" valign="top" align="right">
        <input
               onserverclick="btnOK_Click"
               id="btnOk"
               runat="server"
               type="button" value="OK" />      
 </td>        
  <td style="width: 50%">    
    <input id="btnClose" runat="server" type="button" value="Close" />
 </td>   
</tr>
</table>   
</ContentTemplate>  
</asp:UpdatePanel>
</asp:Panel>

Usercontrol.ascx.cs  


protected void btnOK_Click(object sender, EventArgs e)
{
            string hi = string.Empty;   
}

  .js file


function fnShowModalPopup(mdlBehaviourID)
{  
  var modal = $find(mdlBehaviourID);

    modal.show();

}

function fnHideModalPopup(mdlBehaviourID)
{  
   var modal = $find(mdlBehaviourID);  
   modal.hide();
}

I have one main page inside that I have the user control in the usercontrol I do have the link to open up the MPE (modalpopup extender). But in main page also I have one grid inside that I have column having combo box. Also in I have certain combo boxes in main page also.

My requirement was, in MPE on click of OK button I want to save the selected value in Combo box. And on click of the close button I want to close the modal popup extender.

That's why on OK button's server click I had put a server side method to get the selected value of the combo and save it to database.

But when I am opening the popup extender and selecting some value from the combo box and clicking the OK button. One small flicker is occurring on the modal popup and server side method is being called. But after that if I am clicking on Close button then popup is not closing.

That means the moment I click on OK button server side method gets called but right after when I click on close button then fnHideModalPoup method is not getting fired and the MPE remains opened.

Also, when I open MPE then all the combo boxes in the main page is being hided. But when I open MPE and change some value in combo box of the MPE and click on Close button to hide the MPE then it hides the MPE but all the combo in the Main page remains hided they don't appear again unless I refresh the page. This is  another issue that i am facing along with the above mentioned.

I don't know for the small functionality why I am getting such vague scenarios. Kindly makeout where I  am wrong.