TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rishabh Singh
NA
10
2.5k
category filters on the basis of search text.
Jun 12 2017 6:48 AM
My Controller is :-
ViewBag.categoryfilter = _context.MasterProductCategory.Include(u => u.MasterProduct).ThenInclude(u => u.Brand)
.Where(u => u.MasterProduct.
ProductName
.Contains(search)).ToList();
Where as MasterProduct is related with MasterProductCategory table on :-
public virtual ICollection<MasterProduct> MasterProduct { get; set; }
Hence Under the Product Name Word it is showing Error. And In My view Page:-
@if (ViewBag.categoryfilter != null)
{
@foreach (var items in ViewBag.categoryfilter)
{
<li class="col-sm-3">
<a href="#" data-target="#@incval" data-toggle="collapse" data-parent="#stacked-menu">@items.CategoryName</a>
<ul class="nav nav-stacked collapse left-submenu col-sm-3" id="@incval">
@foreach (var item in ViewBag.categoryfilter)
{
<li class="pad-left-15"><a href="#">@item.BrandName</a></li>
}
</ul>
</li>
incval++;
}
}
These Are my codes to bind the category and respected brand on the basis of prodeuctname.
I am using VS2017 with asp.net-core Please Guide me with suitable solution to bind it properly.
Reply
Answers (
4
)
List of letters and numbers sorting
Convert row data to column