associate aliases with namespaces and class names to use concise notation in custom server control syntax. <%@ Register tagprefix="TagPrefix" namespace="namespace"assembly="Assembly"%> <%@ Register tagprefix="TagPrefix"Tagname="tagname"Src="Pathname"%>The TagPrefix property is the alias associated with the namespace. TagName the alias associated with the class. namespacethe namespace associated with the TagPrefix. SRC and tagprefix:tagname the location (relative or absolute) of the associated declarative user control file. Assembly the Assembly in which the namespace associated with the TagPrefix resides. Note Assembly names do not include file name extensions. Note If you include the @ Register directive in a page or user control, you can use declarative custom server control syntax for custom server controls or user control layouts. Use the @ Register directive in the following cases. Add a custom ASP. NET server control to a page or user control by declaring it. Adds a declarative user control to a page or user control. For declarative user controls, use the TagName, TagPrefix, and SRC properties. When you declare a control in a page, the first two properties are always used in the form of a colon-delimited pair (tagprefix:tagname). The SRC attribute value can be either a relative path from the application root to the user control's source file, or an absolute path. For ease of use, it is recommended to use relative paths. For example, assume that all application user control files are stored under the subdirectory \usercontrol of the application root directory. To include the user control in the Usercontrol1.ascx file, include the following in the @ Register directive: SRC="~\usercontrol\usercontrol1.ascx"Tilde (~) represents the root directory of the application. Note If the user control and the page that contains the control are in the same directory, the SRC attribute value should be the file name and extension of the. ascx file. When you include a custom server control that has been compiled as a. dll file for use by your application, associate TagPrefix with assembly andnamespaceproperty to be used together. If you do not includenamespaceproperty, or an empty string is assigned to the property, a parser error occurs. Warning when you develop a custom server control, you must include it in the namespace. If it is not included in the namespace, the control will not be accessible from the ASP. For more information about developing custom ASP. NET server controls, see Developing Simple ASP. Example the following code fragment uses the @ Register directive to declare the TagPrefix and tagname aliases of server controls and user controls. The first instruction declares the MyTag alias as the tag prefix for all controls residing in the Mycompany:mynamespace namespace. The second instruction declares Acme:adrotator as the tagprefix:tagname pair for the user control in file Adrotator.acscx. Then, use aliases in the form's custom server control syntax to insert an instance for each server control. <%@ Register tagprefix="MyTag" namespace="Mycompany:mynamespace"assembly="myassembly"%> <%@ Register tagprefix="Acme"Tagname="AdRotator"Src="Adrotator.ascx"%> "Server"> <mytag:mycontrol id="Control1"runat="Server"/><br> <acme:adrotator file="Myads.xml"runat="Server"/> </form> </body> C # <%@ Register%> directive