Last post Mar 06, 2018 09:04 AM by Cathy Zou
Mar 05, 2018 08:19 PM|4itguy|LINK
i have made a product list view for showing products according to category,ocassion,size,color. These all contains various option with checkox . with them.
when ever the user clicked these options result is shown according to them.he can select more then one value.
my problem is that how can i fetch data from these multiple option on controller side and then return it back as a singel result.
(Actual i want to make a product list page like Amazon.So when ever the user select the particular option then the product should get selected from db and the result is shown in view).
thanks for your help in advance
Mar 05, 2018 09:25 PM|EnenDaveyBoy|LINK
create a viewModel containing the various elements you need, you can use arrays for multiples of the same type, although they can sometimes need helpto stay clean.
bind the html form elements to the viewModel
build a slq query based on which fields have been populated
return the products
(this gets more and more complex the more search fields u want, and the more functions you add like paging)
Mar 06, 2018 09:04 AM|Cathy Zou|LINK
As enendaveyboy suggest, May be you could use ViewModel to solve you rproblem
If you have any problem when use it, please show me your code and details about you problem.