【问题标题】:How to get the item's details in search bar?如何在搜索栏中获取项目的详细信息?
【发布时间】:2021-09-09 21:36:40
【问题描述】:

我正在使用 ASP.NET Core MVC 构建电子商务 Web 应用程序。我的 _layout 页面上有一个搜索栏。我想显示商品的详细信息,例如图像、标题和价格,这些值已经存储在数据库中。我附上了一张带有这个问题的图片。我想让我的搜索栏变成这样的图片:

我的搜索条形码如下:

<div class="olContent f1">
    <form method="get" asp-controller="Home" asp-action="AllProducts">
        <div class="olSearch fr">
            <input type="text" name="search" placeholder="Enter Keyword" class="inputComn form-control"/>
            <div class="searchIcon">
                <button type="submit" class="searchBtn">
                    <img src="~/images/searchIcon.png"/>
                </button>
            </div>
        </div>
    </form>
</div>

【问题讨论】:

标签: javascript c# html asp.net-core searchbar


【解决方案1】:

您可以使用 twitter typeahead jsplugin。有了这个,您可以选择设计自己的模板(即您的搜索应该如何显示)。 浏览上述链接中的自定义模板。

https://twitter.github.io/typeahead.js/examples/

【讨论】:

    猜你喜欢
    • 2016-04-11
    • 1970-01-01
    • 1970-01-01
    • 2018-12-16
    • 2016-07-11
    • 1970-01-01
    • 1970-01-01
    • 2019-01-18
    • 2018-07-06
    相关资源
    最近更新 更多