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开发者_Go百科 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.
精彩评论