如何引用 “用户控件”---在web.config中

<system.web>

    
<pages>
      
<controls>
        
<add tagPrefix="user" tagName="RandomQuote" src="~/UserControls/RandomQuote.ascx"/>
      
</controls>
    
</pages>

  
</system.web>
但是:
Be aware that there is one important limitation when registering User Controls in the Web.config file. When a User Control is registered in the Web.config file, you cannot place the User Control in the same folder as a page that uses the User Control. To work around this limitation, you should always place all of your User Controls in a separate folder. I typically create a User Controls folder for each of my web applications.

posted on 2007-10-12 16:25  simhare  阅读(500)  评论(0编辑  收藏  举报

导航