【发布时间】:2018-12-07 21:09:15
【问题描述】:
应用程序有标签: 所有、电脑、电话
产品搜索应该依赖于给定的标签,也就是说,如果我们浏览手机标签,搜索时只有手机应该显示给我们。
类:
产品:
public int Id {get; set; }
public string Name {get; set; }
public decimal Price {get; set; }
public int CategoryId {get; set; }
类别:
public int Id {get; set; }
public string Name {get; set; }
查看:
@using (Html.BeginForm ("Index", "Product", FormMethod.Get, null))
{
div class="input-group"
input id="search" type="search" class="form-control" name="search"
placeholder= "Search ...">
button class="btn btn-default">Search button>
div>
}
【问题讨论】:
-
@Johan 的 answer 会很有帮助。
标签: c# asp.net-mvc