Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I've inserted simple example code below that if you run it using IE 6 you will see the dropdownlist control disappears when you display a Ajax modalpopupextender.

Can someone show me how to modify this code so that the dropdownlist control does NOT disappear. I appreciate any help to solve this problem.

Thank You!
XML
<![CDATA[<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApp.WebForm1" %>]]>
<![CDATA[<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>]]>
<html>
<head runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
    </asp:scriptmanager>
    <div>
        <table>
            <tr>
                <td>State:</td>
                <td>
                    <asp:dropdownlist id="ddlState" runat="server" autopostback="true" xmlns:asp="#unknown">
                        <asp:listitem>WI</asp:listitem>
                        <asp:listitem>NY</asp:listitem>
                        <asp:listitem>GA</asp:listitem>
                    </asp:dropdownlist>
                </td>
            </tr>
            <tr>
                <td> </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <asp:button runat="server" text="Try It Using IE6" id="btnTryIt" onclick="btnTryIt_Click" xmlns:asp="#unknown" />
                </td>
            </tr>        
        </table>
    </div>
    <asp:button id="btntar" runat="server" style="display: none" xmlns:asp="#unknown" />
    <cc1:modalpopupextender id="mpePanel" runat="server" targetcontrolid="btntar" behaviorid="ClosePanel" xmlns:cc1="#unknown">
          PopupControlID="pnlTest"&gt;
    </cc1:modalpopupextender>
    <asp:panel id="pnlTest" runat="server" backcolor="Brown" width="300px" height="250px" enableviewstate="false" xmlns:asp="#unknown">
        <div style="color: White;">I created this simple example of a dropdown control (that disappears) using an AJAX ModalPopupExtender. Can someone modify this code where the state DROPDOWN CONTROL will not disapper in IE6 while this modalpopup window is displayed? I would greatly appreciate it!</div>
        <div align="center" style="padding-top: 20px;">
            <input type="button" runat="server" id="btnClose" onclick="$find('ClosePanel').hide();" value="Close" />  
        </div>
    </asp:panel>    
   
    </form>
</body>
</html>

C#
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
namespace WebApp
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        protected void btnTryIt_Click(object sender, EventArgs e)
        {
            mpePanel.Show();
        }
    }
}
Posted
Updated 22-Jul-10 3:26am
v2
Comments
Sandeep Mewara 22-Jul-10 9:27am    
Well, almost whole world has moved on to IE7 & IE8 now. I doubt someone replicating and looking into IE6 issues.

The dropdown component is explicitly hidden because in IE6 this would otherwise be above the modalpopup. Most good javascript popup libraries that use div element as popup do this. Look at the link below (that is not normally available on the site though) and view the example on the bottom of the page. Above that you see a dropdown that is hidden when using IE6.

http://www.javascripttoolbox.com/lib/popup/example.php[^]

Normally the dropdown will be shown again after the popup is closed.

Good luck!
 
Share this answer
 
Comments
Dalek Dave 22-Jul-10 13:44pm    
The world would be better off without it, but as you say in your comment on my entry, some companies refuse to change.
I have made FF the default browser at work for all machines.
STOP!

Do nothing for IE6, refuse to work on it, sabotage every product that requires it!

It is unsupported, has major flaws and is being phased out across the world.

If people still use it and can find functionality, that is their lookout.
 
Share this answer
 
Comments
E.F. Nijboer 22-Jul-10 12:50pm    
Try explain that to several large companies (some very large and international) that I do work for and some of them are now slowly moving towards IE8 but still aren't there. I must say this is something microsoft infected the world with them self together with a flawed implementation of an xml parser and still people trust these products today. It's like people simply trust anything as long as they have to pay for it... very strange. It's not that simple to get big companies to update their systems because for years software has been developed depending on the flawed implementation and counting on the ongoing strange behaviour they have. But I surely understand your point and couldn't agree more with you. :)

Ps. even this site codeproject.com isn't correctly displayed on my office laptop that has IE7 installed. At home using Ubuntu and firefox I can watch it in full glory :-P
Usually the dropdown comes up always on top thats why in IE 6,It sets them invisible when showing the Modal Popup and it gets visible when the hide() method is executed.
IT HAPPENS ONLY IN IE6. IT WORKS FINE IN IE7,IE8 AND MOZILLA
To get it run on IE6, we need to fetch all dropdowns of document and make them visible.

var count = document.getElementsByTagName("select").length;
for (i = 0; i < count; i++)
{
document.getElementsByTagName("select")[i].style.display='block';
document.getElementsByTagName("select")[i].style.visibility='visible';
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900