NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

@ Register

The @ Register directive associates aliases with namespaces and class names for concise notation in custom server control cyntax.

<%@ Register Tagprefix="tagprefix" Namespace="namespace" %>
<%@ Register Tagprefix="tagprefix" Tagname="tagname" src="pathname" %>

Attributes

tagprefix
An alias to associate with a namespace.
tagname
An alias to associate with a class.
namespace
The namespace to associate with tagprefix.
src
The location (relative or absolute) of the pagelet control associated with tagprefix:tagname.

Remarks

In custom server control syntax, a tagname is always used in conjunction with a tagprefix as a colon-separated pair: tagprefix:tagname. A tagprefix can be used alone in a custom server control tag, but a tagname cannot.

Example

The following fragment uses <% Register %> directives to declare tagprefix and tagname aliases for a server control and a user control. The first directive declares the MyTag alias as a tagprefix for all controls residing in the MyCompany:MyNameSpace namespace. The second directive declares Acme:AdRotator as a tagprefix:tagname pair for the user control defined in the file adrotator.aspc. The aliases are then used in custom server control syntax within the form to insert an instance of each server control.

<%@ Register Tagprefix="MyTag" Namespace="MyCompany:MyNameSpace" %>
<%@ Register Tagprefix="Acme" Tagname="AdRotator" src="adrotator.aspc" %>
<HTML>
 ...
   <form runat="server">
      <MyTag:MyControl id="Control1" runat="server" /><BR>
      <Acme:AdRotator file="myads.xml" runat="server" />
   </form>
 ...
</HTML>

See Also

ASP+ Page Syntax | Directives