Difference between User Control and Custom Control

2019-05-13 00:55发布

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

3条回答
欢心
2楼-- · 2019-05-13 01:18

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.

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.

查看更多
来,给爷笑一个
3楼-- · 2019-05-13 01:18

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:

enter image description here

查看更多
男人必须洒脱
4楼-- · 2019-05-13 01:19

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.

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).

查看更多
登录 后发表回答