Hiding the ListSearch Extender Prompt Message

You can hide the ListSearch Extender’s prompt message, so that it does not show, by setting the style to “display:none”, like this.

Define a CSS class in a StyleSheet”StyleSheet.css”:
.DontShowListSearchPrompt
{
    display:none;
}

Then in your ASPX use the Style for the ListSearch Prompt:

<head runat=”server”>
    <title>Don’t show ListSearch Extender Prompt</title>
    <link href=”StyleSheet.css” rel=”stylesheet” type=”text/css” />
</head>
<body>
    <form id=”form1″ runat=”server”>
        <asp:ScriptManager ID=”SM1″ runat=”server” />

        <asp:ListBox ID=”LB1″ runat=”server”>
            <asp:ListItem>Hello</asp:ListItem>
        </asp:ListBox>
        <cc1:ListSearchExtender ID=”LSE1″ runat=”server”
                           PromptCssClass=”DontShowListSearchPrompt
                           TargetControlID=”LB1″>
        </cc1:ListSearchExtender>
    </form>
</body>
</html>

12 thoughts on “Hiding the ListSearch Extender Prompt Message

  1. PT

    Hi,

    I have updated my code in AJAXControlToolkit and put new dll into bin folder of the application. But I don’t see the the changes(mean I’m still seeing ‘type to search’ which I wanted to use dontshowprompt css class). I also can’t see the updates when I run Toolkit test project which is inside the same project. And when I run SampleWebSite under that project, first time click on the list got a javascript error and later, it works.
    Can you please point me out, where to put new dll and whether am I on the right track or not? Actually, I want to display the text typing on status bar, but no ‘type to search’ text. Can you show me how that can be done?

    thanks a lot!

    Reply
  2. dmehers

    You shouldn’t need to create a new DLL or update the control toolkit to work — just define the CSS and use the CSS class as the PromptCssClass …

    Reply
  3. PT

    Thanks for the reply dmehers. I tried it, but it only works for list search in SampleWebsite, and doesn’t even work for ToolkitTests project and neither for my project. Any idea what might the cause be?

    Reply
  4. PT

    I got hiding ‘type to search’ works. I was trying to add and use ‘css’ file from AjaxControlToolkit, whereas the solution is I just need to create a new css file for my project and add the ‘style’ code there and call it from my aspx file. See? I’m a noob here, don’t know which stylesheet you guys were talking about and I’m looking for it. Thanks again!

    Reply
  5. nathaniel engelsen

    ok, it killed the HTML out of my .ASPX. let’s try unicode.

    “asp:DropDownList ID=”ddlCommodity” runat=”server” Width=”250px” DataTextField=”commoditydesc” DataValueField=”commodityid””
    “/asp:DropDownList”

    “cc1:ListSearchExtender PromptCssClass=”noshow” id=”lseCommodity” runat=”server” TargetControlID=”ddlCommodity”/”

    Reply
  6. dmehers

    Hi Nathaniel,

    How are you referencing the style.css CSS from your ASP.NET page?

    Could you try using another class from the CSS file in your ASP.NET page to ensure that the CSS is being properly referenced?

    Reply
  7. nathaniel engelsen

    I’m referencing the style.css CSS file inside of the master page. The LSE is on a DropDownList and both are inside of a table cell.

    The table cell has borders and background set by classes from within the style.css, so it’s definitely being properly referenced.

    All of this, btw, is inside of an UpdatePanel.

    Also, I tried doing a custom Animation using HideAction, but the documentation for a ListSearchExtender mentions the OnShow and OnHide events, neither of which exist, apparently, because I get an error when I try to wire them to the animation.

    But here’s what apparently worked —

    When I moved the ListSearchExtender out of the table cell it was in (but still within a master layout table), it apparently decided to stay hidden.

    Reply
  8. Ashley Lewis

    I can’t type at all. Listboxes aren’t editable, so “Type to search” makes no sense because you can’t type. You can’t edit Listboxes at all and adding a list search extender doesnt automagicly make them editable.

    It all seems like the AJAX toolkit is in over its own head

    Reply
  9. Ahmad

    Hi,The right sidebar is tounihcg the middle column in the homepage as you can see. I want to change the size same like left sidebar, not tounihcg the middle column.Thanks for reply.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *