Hi,

I am having issues with popup panels disappearing because the control is posting back
I have a popup extender on a page which pops out a panel that contains a control I have created

        <asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager>
        <ajaxToolkit:ModalPopupExtender ID="PopupExtender1" PopupControlID="Panel1" runat="server" TargetControlID="Button1">
        </ajaxToolkit:ModalPopupExtender>

                <asp:Panel ID="Panel1" runat="server" BorderStyle="None" BorderWidth="1px" 
                        ClientIDMode="Static" HorizontalAlign="Center" Visible="False">
                            <uc1:UserControl1 ID="UCControl1" runat="server" 
                        Visible="False" />              
                </asp:Panel>

My problem is that every time I click on ButtonA on UserControl1 the popup disappears when I want it to update the error label on UCControl1 if there is an error and only disappear if everything is ok. I have tried surrounding the Panel1 with an updatePanel with conditional update mode and triggers. ButtonA is

<asp:LinkButton ID="ButtonA" runat="server" CssClass="buttonMid" 
                            onclick="ButtonA_Click"></asp:LinkButton>

Thanks in advance
K

Recommended Answers

All 5 Replies

Make sure that you call the popup again, in the button click event handler.

How would I do that from my control?
ButtonA is on the contorl not on the page that the control is on.

Thanks

Create an instance of the popup control, and call it again.

This is an example creating an instance of a scriptmanager, on a master page, and registering a control ...

MasterPage Mp;
Mp = Master;
ScriptManager sm = (ScriptManager)Mp.FindControl("ScriptManager1");
sm.RegisterAsyncPostBackControl(somecontrol);`

Thanks for the help,

I checked for text in the error lable on the control

Control1.FindControl("lblError")

If it contained any text I did

PopupExtender.Show()

Did it work?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.