如何引用 “用户控件”---在web.config中
<system.web>
<pages>
<controls>
<add tagPrefix="user" tagName="RandomQuote" src="~/UserControls/RandomQuote.ascx"/>
</controls>
</pages>
</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.