开发者

Problem with ModalPopupExtender in AJAX in asp.net c#

开发者 https://www.devze.com 2023-03-31 12:41 出处:网络
I have one form to save customer details.For that i have used updatepanel & formview. Also i used modalpopupextender to open popup in Click event of image button inside that form. But when i am us

I have one form to save customer details.For that i have used updatepanel & formview. Also i used modalpopupextender to open popup in Click event of image button inside that form. But when i am using modalpopupextender then i cant save my customer details, without use of modalpopupextender i can save customer details. For that i have added code as following, but its giving error as "An extender can't be in a different UpdatePanel than the control it extends." :

    <asp:ImageButton ID="imb1" 
            Text="Refresh Panel"
            runat="server" />
<asp:ScriptManager ID="ScriptManager1" 
                   runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" 
                 UpdateMode="Conditional"
                 runat="serv开发者_如何学Goer">
                 <Triggers>
                   <asp:AsyncPostBackTrigger ControlID="imb1" />
                 </Triggers>
                 <ContentTemplate>
               // Here is my code to add 

                 </ContentTemplate>
</asp:UpdatePanel>

Please help me what to do? Asp.net c#


This error raises because your button which is used to open popup in updatepanel and your modal popup in any other update panel or you have placed it out of update panel.

Solution 1: place modal popup inside update panel in which your calling popup button exist.

solution 2: place button outside update panel and modal popup too.

Both things should be placed in same condition if button in update panel then popup should also be in same update panel And if button outside update panel then popup also outside update panel.

If you find your solution kindly mark my answer and point it up,thanks.


You're receiving this error because the TargetControlID, assuming it's the image button, resides outside of the update panel.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号