Loading ...

Modal pop up with in update panel | CodeAsp.Net

Modal pop up with in update panel

 /5
0 (0votes)

I have faced a abnormal behaviour of modal pop up when used it with update panel. I have used five modal up in a single page and  show modal popup in different condition. (not on a click of button) So I used a common dummy button which is visible false.(because we cannt leave the TargetControlID of popup extender.)

Its working fine untill I havent enclosed with in update panel. But when I enclosed it in update panel then on a single condition is true all the popup will open and when I cancel anyone of them then all the popup will closed. Even javascript which I had written in code behnd was also not working.

So to resolve my problem I have to use seprate dummy buttons for each of these modal pop up.

<asp:UpdatePanel ID="updtpnlBoard" runat="server">
<ContentTemplate>

<asp:Button ID="btnDummy1" runat="server" Text="Button" />

<asp:Button ID="btnDummy2" runat="server" Text="Button" />

<ajaxToolkit:ModalPopupExtender ID="mpe1" runat="server" TargetControlID="btnDummy1" PopupControlID="pnl1" EnableViewState="true" />


<asp:Panel ID="pnl1" runat="server" Width="400px">

// popup content goes here
</asp:Panel>

<ajaxToolkit:ModalPopupExtender ID="mpe2" runat="server" TargetControlID="btnDummy2" PopupControlID="pnl2" EnableViewState="true" />
<asp:Panel ID="pnl2" runat="server" Width="400px">

// popup content goes here

</asp:Panel>

</ContentTemplate>
</asp:UpdatePanel>

 

Hope this will help...

Comments (5)

   
Shaitender
Nice post
2/26/2009
 · 
by
   
kristof
really cool man
4/8/2009
 · 
by
   
r4 nintendo ds
rather then using modalpop, you should try to use modalbox. It is a fine control and easy to use.
9/24/2009
 · 
by
   
vinay_jss
yes you are right, I am using modal box but this blog is there for help to newbie who wants to use modal pop up.
9/24/2009
 · 
by
   
Eliza Sahoo
Hi. Nice post.I also have a something similar to share.

UpdatePanel is used in ASP.NET for doing partial postback. Suppose you are having a page and you want some portion of that page to be refreshed or changed, so in that case why refresh the whole page. In this scenario we may use UpdatePanel and the control inside that updatepanel will get refreshed or changed not the full page(if we want to refresh the whole page then we can do that also).Apart from that we can have controls which will act as the trigger for partial postback of the updatepanel.It can be a child control(Control inside the updatepanel) or a control outside the update panel.
1/27/2010
 · 
by

Top Posts