The @Register directive associates aliases with namespaces and class names for notation in custom server control syntax. When you drag and drop a user control onto your .aspx pages, the Visual Studio 2005 automatically creates an @Register directive at the top of the page. This register the user control on the page so that the control can be accessed on the .aspx page by a specific name.
@ Register
<%@ Register tagprefix="tagprefix"
namespace="namespace"
assembly="assembly" %>
<%@ Register tagprefix="tagprefix"
namespace="namespace" %>
<%@ Register tagprefix="tagprefix"
tagname="tagname"
src="pathname" %>
assembly:
The assembly in which the namespace associated with the tagprefix attribute resides.
namespace:
The namespace of the custom control that is being registered.
src:
The location (relative or absolute) of the declarative ASP.NET User Controls file to associate with the tagprefix:tagname pair.
tagname:
An arbitrary alias to associate with a class. This attribute is only used for user controls.
tagprefix:
An arbitrary alias that provides a shorthand reference to the namespace of the markup being used in the file that contains the directive.
Register directive in ASP.Net
Hot on Web: