果园Ajax请求

Currently we have a few products defined in Orchard. We managed do display these products by using a query in combination with projection. I executed the same steps as described in this tutorial, Defining and rendering the ProductCatalog Content Type

There is also a menu to navigate inside products catalog. When selecting category, the full page is refreshed. How can we implement a ajax request each time user select a product category in menu?

Here i will show you an example of the screen: Products Overview

I guess your best bet is to do something along those lines:

  • Create a module with a custom ApiController
  • Write an alternate for your category navigation in which you send an ajax request to your controller
  • Use IContentManager in your controller to query for your products and return them as a json result
  • Update your page from your result