Default Button

2 posts, 0 answers
  1. Patric Svensson
    Patric Svensson avatar
    14 posts
    Member since:
    Nov 2006

    Posted 14 Feb 2013 Link to this post

    Hi, when i press enter in the Textbox (input), I wan't the default button (in the Panel) to hit, so I jump in to the "SearchOnClick" method on enter press, but i can't get it to work. When i press enter nothing happens. How can i solve this?

    <asp:Panel runat="server" ID="SearchPanel" DefaultButton="BtnSearch" CssClass="search-box">
        <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox2" AllowCustomEntry="true" TextSettings-SelectionMode="Single"
            OnClientDropDownOpened="GUI.AutoCompletedOpened" OnClientRequestFailed="GUI.SearchRequestFailed"
            OnClientTextChanged="GUI.SearchInputChanged" InputType="Text" Filter="StartsWith" Width="180px" DropDownWidth="300px" 
            CssClass="telerik-search"  EnableEmbeddedSkins="False" EnableEmbeddedBaseStylesheet="False" OnEntryAdded="Search_Entry">
            <WebServiceSettings Path="~/Views/Search/SearchResult.aspx" Method="GetSearchResult"></WebServiceSettings>
                    <div style="display: #= Attributes.DisplayMode #">
                        <a href="#= Attributes.ProductUrl #">
                            <span class="image-holder">
                                <img src="#= Attributes.ImageUrl # " alt=" #= Text # " width="50" height="50" />
                            #= Text # <br />
                            <span>#= Attributes.Identifier #</span>
                        #= Attributes.SearchUrl #
        <asp:HiddenField runat="server" ID="hSearchValue" ClientIDMode="Static" />
        <asp:Button id="BtnSearch" runat="server" OnClick="SearchOnClick" CssClass="search"  />
  2. Kate
    Kate avatar
    1898 posts

    Posted 19 Feb 2013 Link to this post

    Hello Patric,

    I would suggest that you try using our new RadSearchBox control that you can find very useful in the scenario that you are trying to achieve. Here, you can also refer to the on-line documentation of the control.

    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top