简体   繁体   English

在3层应用程序中具有中继器控件的优缺点是什么?

[英]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. 中继器控件与3层应用程序的好坏无关。 It's simply a pre-built ASP.NET control that you can use to iterate over data. 它只是一个预构建的ASP.NET控件,可用于遍历数据。 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. 服务器控件通常会有很多开销,因为它们旨在抽象化Web(它们也具有自己的生命周期)并为绑定和事件处理提供挂钩。 If you don't need to do any event handling, then I would recommend just using a simple loop. 如果您不需要执行任何事件处理,那么我建议您仅使用一个简单的循环。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 3层Web应用程序的体系结构说明 - Architecture Clarification for 3-tier web application 浏览3层应用程序中的记录 - Navigate Through records in 3-tier application 将CSS作为主题的一部分的利弊 - Pros and cons of having CSS as part of a theme 在将Web应用程序保留在一个默认应用程序池中的情况下,拥有专用应用程序池的利弊 - Pros and cons of having dedicated application pools over keeping web applications in one default app pool 如何在asp.net 3层应用程序中处理此异常? - How to handle this exception in asp.net 3-tier application? 在asp.net webform应用程序中选择启用Ajax的WCF服务有什么优缺点? - What are the pros and cons when choosing ajax enabled WCF service in an asp.net webform application? 使用文字控制与精确控制以及runat = server的利弊 - pros and cons, using literal control vs exact control and runat=server 3层架构业务逻辑 - 3-tier Architecture business logic 在Silverlight中构建企业级业务线应用优点和缺点 - Building Enterprise level Line of Business application in silverlight Pros and Cons 使用asp.net会员资格有哪些优缺点? - What are the pros and cons using the asp.net membership?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM