ModalPopupExtender... Help please!!!

Last post 12-06-2006 12:00 PM by foeng. 10 replies.

Sort Posts:

  • ModalPopupExtender... Help please!!!

    10-22-2006, 6:24 PM

    Dears,

    I have one webform with many components, between these 4 DropDownList.
    In this exactly webform, I am trying to use the ModalPopupExtender component, making the call “server” it saw method Show. How I can decide this problem?
    Everything is functioning well, however, when I hide the ModalPopupExtender (“hide” saw server), mine 4 DropDownList disappear of the screen.
    How I can decide this problem?

    Thanks!
    []s,
    Alessandro.

    Alessandro Ferreira
  • Re: ModalPopupExtender...Databound controls disappear in IE, not Firefox

    10-27-2006, 3:56 PM
    • Member
      47 point Member
    • susanh
    • Member since 10-05-2006, 9:09 PM
    • Posts 15
    It sounds like we have the same problem.  I had a page with databound controls and a ModalPopupExtender that worked fine before the Oct. 21 beta 1, but now the databound controls disappear as soon as the modal popup displays -- in IE 6.  It works perfectly in Firefox 1.5.0.7.  Alessandro, what browser are you using?

    Here is a simple example.  It has a listbox, populated from the code behind, and a button that causes a modal popup to display via the code-behind page.  Am I doing something wrong, or is this a new bug in AJAX?

     

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NakedPage.aspx.cs" Inherits="Director.Web.NakedPage" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager id="ScriptManager1" runat="server" EnablePartialRendering="true" />
    
            <asp:UpdatePanel id="testPanelA" runat="server" updatemode="conditional">
                <ContentTemplate>
                    <asp:Button ID="ButtonA" runat="server" Text="Button A" OnClick="btnA_Click" />
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostbackTrigger ControlID="ButtonA" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
    
            <asp:UpdatePanel id="testExtenderPanelA" runat="server" updatemode="conditional">
                <ContentTemplate>
                    <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderA" runat="server" BackgroundCssClass="modalBackground" 
                            PopupControlID="panelA" TargetControlID="FakeTargetA"/>
                    <asp:Button ID="FakeTargetA" runat="server" Style="display: none;" />
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostbackTrigger ControlID="ButtonA" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
    
            <asp:UpdatePanel ID="updPanelA" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:Panel ID="panelA" BorderColor="Green" BorderStyle="Solid" BorderWidth="1" BackColor="#ffcc66" runat="server" Style="display: none; width:80px;">
                        This is Panel <b>A</b>.
                        <asp:Button ID="btnYesPanelA" Text="Yes" runat="server" OnClick="btnYesPanelA_Click" />
                        <asp:Button ID="btnClosePanelA" Text="Cancel" runat="server" OnClick="btnClosePanelA_Click" />
                    </asp:Panel>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostbackTrigger ControlID="ButtonA" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
                        
            <asp:UpdatePanel id="databoundControls" runat="server" updatemode="always" RenderMode="inline">
                <ContentTemplate>
                    <asp:Label ID="Label1" runat="server" Text="Label that appears before the listbox"></asp:Label><br />
                    <asp:ListBox ID="lstDances" runat="server" SelectionMode="Multiple" CssClass="inputMedium" AutoPostBack="false"></asp:ListBox>
                    <br /><asp:Label ID="Label2" runat="server" Text="Label that appears b> the listbox"></asp:Label>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostbackTrigger ControlID="FakeTargetA" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>  
    
        </form>
    </body>
    </html>
    

     

    //.........and the code behind.......... 

     

    using System;
    using System.Collections;

    namespace Director.Web
    {
    public partial class NakedPage : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {
    if (!IsPostBack)
    {
    PopulateDancesList();
    }
    }

    private void PopulateDancesList()
    {
    ArrayList arrList = new ArrayList();
    arrList.Add("An Rince Mor");
    arrList.Add("Eight Hand Reel");
    arrList.Add("High Cauled Cap");
    arrList.Add("Seige of Carrick");
    lstDances.DataSource = arrList;
    lstDances.DataBind();
    }

    protected void btnA_Click(object sender, EventArgs e)
    {
    ModalPopupExtenderA.Show();
    }
    protected void btnYesPanelA_Click(object sender, EventArgs e)
    {
    //Do stuff
    }
    protected void btnClosePanelA_Click(object sender, EventArgs e)
    {
    //Do some work
    ModalPopupExtenderA.Hide();
    }
    }
    }

     

  • Re: ModalPopupExtender...Databound controls disappear in IE, not Firefox

    10-27-2006, 4:12 PM
    • Contributor
      4,482 point Contributor
    • jodywbcb
    • Member since 03-12-2003, 3:52 PM
    • West Seattle,WA
    • Posts 985
    I have posted a bug on Codeplex as this was an error I had already reported and blogged about.  If you browse the recent blogs I detail it with some workarounds.  However, in short if setting the UpdatePanel mode to Always - you should be able to retain most of the databound controls...
    -- jody
    My Blogs on .Net 2.0 and Ajax
    http://csk.wbcb.com
    http://ArtbyJody.com
  • Re: ModalPopupExtender...Databound controls disappear in IE, not Firefox

    10-27-2006, 4:19 PM
    • Member
      47 point Member
    • susanh
    • Member since 10-05-2006, 9:09 PM
    • Posts 15

    Hey, thanks for the reply!

    I did look at your post actually, but I couldn't find anything to help my page.  I added updatemode="always" to the UpdatePanel around my databound control, but it didn't change the behavior.  Do you see anything in the code I posted that jumps out as a red flag?  Did you try your code before the fix in Firefox and were you using IE6 when the problem happened?

     

  • Re: ModalPopupExtender...Databound controls disappear in IE, not Firefox

    10-27-2006, 4:31 PM
    • Contributor
      4,482 point Contributor
    • jodywbcb
    • Member since 03-12-2003, 3:52 PM
    • West Seattle,WA
    • Posts 985

    MOst of the time it works properly in FireFox but FireFox is much more forgiving I think....My post 

    here reflects how I worked around it.  Also - I have found that using the Update() feature of the UpdatePanel does this.  Particulary will hide messages if you have mode = Always...

     

    So if you are doing Update()  need to add a bit more logic such as :

     

    if (UpdatePanelModal.UpdateMode.ToString() != "Conditional")
                            {
                               // UpdatePanelModal.Update();
                            }
                            MyPopUp.Hide();
                            

     

    Wish I could provide an accurate solution...you could try moving your Show() hide to the PreRender Phase...  which occurs just before the SCMs does it magic.

     

    Additionally and important to note - not a single person who uses javascript to control the show or hide have reported these issues... so...

     

     

     

     

     

     

    -- jody
    My Blogs on .Net 2.0 and Ajax
    http://csk.wbcb.com
    http://ArtbyJody.com
  • Re: ModalPopupExtender...Databound controls disappear in IE, not Firefox

    10-27-2006, 4:33 PM
    • Contributor
      4,482 point Contributor
    • jodywbcb
    • Member since 03-12-2003, 3:52 PM
    • West Seattle,WA
    • Posts 985

    And thanks for posting the question - and demonstrating the issue as I thought I WAS THE ONLY ONE... as I have blogged and posted about it like crazy and this has been a issue when Ajax was formerly Atlas (least with Atlas I did get a fix for it).... but the changes never got rolled back in as the coding model changed for their js...

     

     

    -- jody
    My Blogs on .Net 2.0 and Ajax
    http://csk.wbcb.com
    http://ArtbyJody.com
  • Re: ModalPopupExtender...Databound controls disappear in IE, not Firefox

    10-28-2006, 5:44 PM
    • Contributor
      2,019 point Contributor
    • Jason Hill
    • Member since 04-23-2006, 3:39 AM
    • Sydney, Australia
    • Posts 479

    Looks like I have the same problem too.  I have a checkboxlist in a ModalPopup which gets wiped after a postback from the popup.  I have tried setting the UpdateMode to "Always", specifically calling Update on the updatepanel and moving the modalpopup within the source but the problem still occurs.  It is happening in both IE7 and FF2.

    Cheers,

    Jason

  • Re: ModalPopupExtender...Databound controls disappear in IE, not Firefox

    11-10-2006, 8:07 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-11-2006, 1:39 AM
    • Microsoft
    • Posts 1,842
    • AspNetTeam
    Please try your scenario with the recently available 61106 release of the Toolkit (and ASP.NET AJAX Beta 2). If the problem persists, then please reply with a complete, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!

    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Angry [:@] Re: ModalPopupExtender...Databound controls disappear in IE, not Firefox

    11-10-2006, 8:20 PM
    • Contributor
      4,482 point Contributor
    • jodywbcb
    • Member since 03-12-2003, 3:52 PM
    • West Seattle,WA
    • Posts 985

    This has NEVER been resolved and I have already created a complete demo to repro the problem using the toolkit's Sample website and keep reporting it For Atlas, Beta 1 and yes now again Beta 2- and is on Codeplex as a download for workitem (Codeplex workitem link).. so please actually look at the repro code ....I made it AS SIMPLE as possible... to demonstrate the issue (and the problem is with both IE and FF)...

     

     From Sept

    Description
    Bug: Popping up a ModalPopUp within its own UpdatePanel causes other update panels to lose DropDownLists (Controls dissapear)

    Scenario: A group of Buttons and DropDownLists and below a GridView within a <UpdatePanel id="up1"> ScriptManager Partial rendering is enabled, Update setting:

    Mode="Conditional" RenderMode="Inline" or "Block"



    A ModalPopUp inside its own <UpdatePane id = "up2" >

    Mode="Conditional" RenderMode="Block" or "Inline"

    When modal is shown() in <UpdatePanel id = "up2" > the dropdown lists in <UpdatePanel id="up1"> dissapear completely but gridview and buttons still remain.

    Takes page refresh to re-init.

    File Attachments

    Closed Sep 18 at 3:01 PM  by davidans

    Comments most recent at top (show oldest at top)
    jodywbcb wrote Sep 19 at 11:41 AM
    Occurs only in IE not Firefox...

    jodywbcb wrote Sep 18 at 7:18 PM
    There is no Re-Open Work Item for my account here....

    jodywbcb wrote Sep 18 at 4:02 PM
    I thought it was pretty self explanatory... attached are my code files - can be reached at v-jodyw [msft] if you actually have questions about the source files...

    davidans wrote Sep 18 at 3:01 PM
    Please attach a simple demonstration of the problem and re-open this issue via the "Re-open Work Item" link on the CodePlex site. Thanks!
     
    This is from Oct Beta 1:
     
    Description
    For screenshots and more description http://tech-review.org/blogs/.net_2.0/archive/2006/10/24/66.aspx

    The file attachment includes duplicating the issue using the modal example of the toolkit.

    Scenario: UpdatePanel has a few databound controls like gridview and dropdownlists and a modalpopup. From codebehind if you invoke the show() - in simple control - click if modal appears then upon invoke the databound controls dissapear. In the example code click the labeled button twice it reproduces the problem (very simple code). If the modal uses a placeholder that invokes dynamic controls then it occurs the first time...and all kinds of work arounds have to occur (as demoed in the blogpost.)

    File Attachments

    Comments most recent at top (show oldest at top)
    jodywbcb wrote Today at 5:50 PM

    Issue is still with Beta 2 as it was Beta 1 and Atlas...


    jodywbcb wrote Oct 26 at 6:55 PM
    If the provided simple example is a easy fix and you want to verify the fix works with dynamic controls - email me at v-jodyw - I am usually on campus 3 times a week and will be more than happy to demonstrate the issue with the application I am developing...
     
     
    It's getting really irritating to  never have the issue even looked at the second time and yet constantly report it.  I got rather miffed because you stated on the Sep issue : Please do a "Re-open Work Item"  when those just members of codeplex do not have that option - and the Oct post - simply has never been looked at or assigned...

     

    -- jody
    My Blogs on .Net 2.0 and Ajax
    http://csk.wbcb.com
    http://ArtbyJody.com
  • Re: ModalPopupExtender...Databound controls disappear in IE, not Firefox

    11-12-2006, 9:50 PM
    • Contributor
      2,019 point Contributor
    • Jason Hill
    • Member since 04-23-2006, 3:39 AM
    • Sydney, Australia
    • Posts 479
    Boy do I feel stupid!!  My problem was the result of an overlooked setting in a parent control of EnableViewState="false"...so I no longer have this problem!  Seems like there might be some other people that do have a genuine issue though.
  • Re: ModalPopupExtender... Help please!!!

    12-06-2006, 12:00 PM
    • Member
      5 point Member
    • foeng
    • Member since 12-06-2006, 4:27 AM
    • Posts 4

    I have the same problem

    This should work as a work around http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=5124 

     

Page 1 of 1 (11 items)