Direct reference on the page
<% @Register tagprefix= "Scott"Tagname= "Header"SRC= "Controls/header. ascx"%>
<% @Register tagprefix= "Scott"Tagname= "Footer"SRC= "Controls/footer. ascx"%>
<% @Register tagprefix= "Controlvendor"Assembly= "Controlvendor"%>
< Html >
< Body >
< Form ID = "Form1" Runat = "Server">
< SCOTT: Header ID = "Myheader" Runat = "Server" />
</ Form >
</ Body >
</ Html >
Configuration file reference (global)
< ? XML Version = "1.0"?>
< Configuration >
< System. Web >
< Pages >
< Controls >
< Add Tagprefix = "Scottgu" SRC = "~ /Controls/header. ascx" Tagname = "Header"/>
< Add Tagprefix = "Scottgu" SRC = "~ /Controls/footer. ascx" Tagname = "Footer"/>
< Add Tagprefix = "Controlvendor" Assembly = "Controlvendorassembly"/>
</ Controls >
</ Pages >
</ System. Web >
</ Configuration >
When the user control is in the same file directory, it cannot be referenced by the configuration file. "Direct reference on the page", the reason is not explained