views:

22

answers:

1

Hello I have a simple ModalPopupExtender sample but can't seem to get it working properly. I've followed the code from an online sample and it's similar to a lot of the other online examples but when I run it, the popup panel will quick show then then hides again. I've set the targetcontrol to a linkbutton and when I click it it will show the popup, triggers a postback then hides it afterwards thus causing a quick flicker.

here is my code...

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:LinkButton ID="LinkButton1" runat="server">Add Item</asp:LinkButton>

<asp:Panel ID="PanelPopup" runat="server" CssClass="ModalPopup" Width="500" Height="350" style="display:none;">
    <h1>test</h1>
    <asp:Button ID="ButtonAdd" runat="server" Text="Add" />
    <asp:Button ID="ButtonCancel" runat="server" Text="Cancel" />
</asp:Panel>

<asp:ModalPopupExtender 
    ID="ModalPopupExtender1" 
    runat="server" 
    BackgroundCssClass="Inactive"
    PopupControlID="PanelPopup"
    TargetControlID="LinkButton1"
    OkControlID="ButtonAdd"
    CancelControlID="ButtonCancel">
</asp:ModalPopupExtender>

I've also added Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" at the top

Can anyone see anything different or wrong about this please? Many thanks!

A: 

It might be because your using the ASP ScriptManager. Try using the ToolkitScriptManager that comes with the AJAXControlToolkit.

BG100

related questions