用户控制和自定义控制之间的区别?

时间:2022-03-04 13:21:16

What are the differences between User Control and Custom Control in ASP.NET

ASP.NET中的用户控件和自定义控件之间有什么区别

3 个解决方案

#1


5  

AFAIK, user controls are controls that you can create out of existing controls and can be part of the project and have a designer surface for you to drag/drop.

AFAIK,用户控件是您可以使用现有控件创建的控件,可以是项目的一部分,并具有可拖放的设计器表面。

Custom controls are generally external to the project & would require to be hand-coded (using various asp.net control events & html building in the code).

自定义控件通常在项目外部,需要手动编码(使用代码中的各种asp.net控件事件和html构建)。

#2


3  

User Controls are inherit from UserControl class by system default and can combine controls in terms of specific UI case and can have UI logic as well and reuse again and again anywhere within project.

用户控件是按系统默认值从UserControl类继承的,可以根据特定的UI情况组合控件,也可以具有UI逻辑,并在项目中的任何位置反复使用。

Custom Controls are inherits from Control class (that you can change any control type what you want to customize) and generally use to add extra ability to an existing UI controls.

自定义控件继承自Control类(您可以更改要自定义的任何控件类型),通常用于为现有UI控件添加额外功能。

#3


0  

Difference between CustomControl and UserControl So, now you got the difference between Custom Control and User Control, I guess. Let's summarize the difference again. Read the comparison below to make it clear:

CustomControl和UserControl之间的区别所以,现在你得到了自定义控件和用户控件之间的区别,我想。让我们再次总结一下这个区别。阅读下面的比较,以明确:

用户控制和自定义控制之间的区别?

#1


5  

AFAIK, user controls are controls that you can create out of existing controls and can be part of the project and have a designer surface for you to drag/drop.

AFAIK,用户控件是您可以使用现有控件创建的控件,可以是项目的一部分,并具有可拖放的设计器表面。

Custom controls are generally external to the project & would require to be hand-coded (using various asp.net control events & html building in the code).

自定义控件通常在项目外部,需要手动编码(使用代码中的各种asp.net控件事件和html构建)。

#2


3  

User Controls are inherit from UserControl class by system default and can combine controls in terms of specific UI case and can have UI logic as well and reuse again and again anywhere within project.

用户控件是按系统默认值从UserControl类继承的,可以根据特定的UI情况组合控件,也可以具有UI逻辑,并在项目中的任何位置反复使用。

Custom Controls are inherits from Control class (that you can change any control type what you want to customize) and generally use to add extra ability to an existing UI controls.

自定义控件继承自Control类(您可以更改要自定义的任何控件类型),通常用于为现有UI控件添加额外功能。

#3


0  

Difference between CustomControl and UserControl So, now you got the difference between Custom Control and User Control, I guess. Let's summarize the difference again. Read the comparison below to make it clear:

CustomControl和UserControl之间的区别所以,现在你得到了自定义控件和用户控件之间的区别,我想。让我们再次总结一下这个区别。阅读下面的比较,以明确:

用户控制和自定义控制之间的区别?