User controls and custom controls

User controls are easy to make, but they can be less convenient to use in advanced scenatios. You can develop user controls almost exactly the same way that you develop web forms pages. Like Web Forms, user controls can be created in the visual designer, they can be written with code separated from the HTML, and they can handle execution events.

However, because user controls are compiled gynamically at run time, they cannot be added to the Toolbox, and they are presented by a simple placeholder when it is added to a page. This makes user controls harder to use if youu are accustomed to full Visual Studio.NET design-time support, including the properties window and Designview previews. Also, the only wat to share the user control between applications is to put a seperate copy in each application, which takes more maintenance if you make changes to the control.

Custom controls are compiled code, which makes them easier to use but more difficult to create; customer controls must be authored in code. Once you have created the control, however, you can add it to the Toolbox and display it in a visual designer with full properties window support and all the other design-time feature of ASP.NET server controls.

In addition, you can install a single copt of the custom control in the global assembly cache and share it between applications, which makes maintenance easier.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值