本文介绍了用户控件、服务器控件和服务器控件有什么区别?自定义控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在最近的一次采访中,我以为我对这个问题有合理的答案,但我轰炸了它.:(

I thought I had reasonable answers for this question at a recent interview, but I bombed it. :(

  • 三者之间的主要区别是什么?
  • 如果上一个项目符号的答案不明显,您什么时候会选择一个而不是另一个?

推荐答案

  • 用户控件是使用设计器在 Web 项目中构建的控件.它们通常只对 Web 应用程序私有(尽管有一些方法可以使它们对其他项目可用).

    • User Controls are controls built with a designer within a web project. They typically are only private to a web application (Although there are ways you can make them available to other projects).

      服务器控件是也称为 Web 控件的控件.这些是可重用的控件,无需设计器的帮助即可呈现其 html,它们是在与 Web 应用程序分开的程序集中创建的,适用于将在许多不同的 Web 应用程序中使用的控件

      Server Controls are controls that are also known as Web Controls. These are reusable controls that render their html without the aid of a designer, they are created in a seperate assembly from the web application, are appropiate for controls which will be used in many different web applications

      复合控件是 Web 控件的子类型,是由其他 Web 控件组成(组合)的控件.

      Composite Controls are a sub type of Web Controls and are controls which are made up (composed) of other web controls.

      除了由您或您的团队自定义构建的控件之外,我从未听说过自定义控件意味着其他任何东西.它可以包括用户、Web 或复合控件.

      I've never heard of a custom control to mean anything other then a control which is custom built by you or your team. And it could include user, web or composite controls.

      这篇关于用户控件、服务器控件和服务器控件有什么区别?自定义控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-18 16:49