简体   繁体   中英

What are the pros and cons of having a repeater control in a 3-tier application?

In terms of data accessing, or any other opinions.

If possible, state a better alternative if any.

The repeater control doesn't have any bearing on whether you have a good or bad 3-tier application. It's simply a pre-built ASP.NET control that you can use to iterate over data. That data can be anything from a datatable to strongly typed class from your model-tier.

We usually stray away from using repeaters unless we are doing something that requires event handling.

Server controls in general have a lot of overhead because they're meant to abstract the web (they also have their own life-cycle) and provide hooks for binding and event handling. If you don't need to do any event handling, then I would recommend just using a simple loop.

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