Registering Your Controls in Web.config

Registering Your Controls in Web.config Each time you add a custom control (or even a user control) to a webpage, Visual Studio generates the @ Register directive to ensure that the control is registered for the page. However, you can register controls globally to your site by using the Web.config file. This allows you to use them on pages much as you would any other ASP.NET control (without the @ Register directive).


Lesson 2: Creating Custom Web Server Controls CHAPTER 7 379
<system.web>
<pages>
<controls>
<add assembly="MyUserControls"
namespace="MyUserControls"
tagPrefix="muc" />
<add src="~/Controls/AddressUserControl.ascx"
tagName="AddressUserControl"
tagPrefix="uc1" />
</controls>
</pages>
</system.web>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值