简体   繁体   中英

What control should I use for showing “Featured Products” on my ASP.net Website?

I have various SQL tables and my use case is:

I'll choose 5 Products at random and they'll show in X control (don't know what to use here).

I know I'll have to use SQL and pull the product information using the ProductID as the hook to fish out every other information.

What Control should I use?

---If you want to show random product, then Adrotator is the best choice
---If you are getting product randomly from DB then Repeater or datalist could be the best choice

Depends how you want do display it.

Maybe a Repeater and ObjectDataSource will be useful, depending on your ORM.

Maybe a DataList , maybe a Repeater . explain more about what you want to show.

Two possibilities spring to my half-asleep mind.

the first would be to use a ListView or Repeater and have it themed out appropriately.

The second possibility would be to create a user control that displays the way you want, and then instantiate 5 instances on the web page.

I would make a user control that would take an array of ids as a property. Encapsulated in the user control would be everything you need to do to display your products. This would probably be an array of panels with images and labels.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM