Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Error-In Chrome ajax autocomplete show behind modal popup
I set z-index:1000 !important; in autocomplete class. but ajax toolkit autocomplete show behind popup. Please post solution for ajax toolkit autocomplete.

What I have tried:

In css -
z-index:1000 !important;
Posted
Updated 11-Jul-21 23:36pm

You haven't shown us any of your code, so we can't tell you precisely what the problem is. But the most likely explanation is that your popup sits in a different stacking context than your autocomplete list.

The stacking context - CSS: Cascading Style Sheets | MDN[^]
What the heck, z-index??[^]
 
Share this answer
 
Css Code

.autocomplete_list
{
    visibility: hidden;
    margin: 0px !important;
    padding: 0px;
    background-color: inherit;
    color: windowtext;
    border: buttonshadow;
    border-width: 1px;
    border-style: solid;
    cursor: default;
    text-align: left;
    list-style-type: none;
    overflow: auto;
    font-weight: normal;
    font-size: 11px;
    z-index: 100;
    font-family: Arial;
}
/* AutoComplete highlighted item */
.autocomplete_highlighted_listitem
{
    background-color: Highlight;
    /*color: HighlightText;*/
    color:Red;
    padding: 3px;
    font-family: Arial;
}

/* AutoComplete item */
.autocomplete_listItem
{
    background-color: window;
    /*color: windowtext;*/
    color:blue;
    padding: 50px;
    font-family: Arial;
    z-index: 1000;
    position:static;
}


<html>
<head></head>
<body>
<table>
<tr>
<td><pre><asp:TextBox CssClass="textbox_SixColumns" BackColor="White" runat="server" ID="TX_USR_UName_A"
                                                            AutoPostBack="true" OnTextChanged="TX_USR_UName_A_TextChanged"></asp:TextBox>
                                                        <br />
                                                        <asp:RequiredFieldValidator ID="RF_TX_USR_UName_A" runat="server" ControlToValidate="TX_USR_UName_A"
                                                            CssClass="RedMessage" Display="Dynamic" ErrorMessage="Please enter username."
                                                            ValidationGroup="VG_Add_U"></asp:RequiredFieldValidator>
                                                        <ajaxToolkit:TextBoxWatermarkExtender ID="AXW_Search" runat="server" TargetControlID="TX_USR_UName_A"
                                                            WatermarkCssClass="watermarkPopup" WatermarkText="Search...">
                                                        </ajaxToolkit:TextBoxWatermarkExtender>
                                                        <ajaxToolkit:AutoCompleteExtender ID="AXAC_AutoSearch" runat="server" MinimumPrefixLength="1"
                                                            ServiceMethod="GetBCSearchAutoCompleteUsers" ServicePath="~/SYS/Sunray/AutoComplete.asmx"
                                                            BehaviorID="bhText" UseContextKey="true" ContextKey="a" CompletionInterval="50"
                                                            TargetControlID="TX_USR_UName_A" CompletionSetCount="10" CompletionListCssClass="autocomplete_list"
                                                            CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlighted_listitem">
                                                        </ajaxToolkit:AutoCompleteExtender></td>
</tr>
</table>
</body>
</html>
 
Share this answer
 
v2

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