The Reference Directive

ASP.NET – Directives

Posted on

ASP.NET – Directives

The Implements Directive

The Implement directive indicates that the web page, master page or user control page must implement the specified .Net framework interface.

The basic syntax for an Implements directive is:

<%@ Implements  Interface=”interface_name” %>

The Import Directive

The Import directive imports a namespace into a web page, user control pate of application. If the Import directive is specified in the global.asax, then it will apply to the entire application. If it is in a page of user control page, then it would apply to that page or control.

The basic syntax for an Import directive is:

<%@ namespace=”System.Drawing” %>

The PreviousPageType Directive

The PreviousPageType directive assigns a class to a page, so that the page is strongly typed.

The basic syntax for a sample PreviousPagetype directive is:

<%@ PreviousPageType attribute=”value”[attribute=”value” …]   %>

The Reference Directive

The Reference directive indicates that another page or user control should be compiled and linked to the current page.

The basic syntax for a sample Reference directive is:

<%@ Reference Page =”somepage.aspx” %>

The Register Directive

The Register derivative is used for registering the custom server controls and user controls.

The basic syntax for a sample Register directive is:

<%@ Register Src=”~/footer.ascx” TagName=”footer”

TagPrefix=”Tfooter” %>

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Advertisements