What is ASP.NET - Directives how to use in Asp.net Programming

What is ASP.NET - Directives how to use in Asp.net Programming :

ASP.NET - Directives:
ASP.NET directives are instructions to specify optional settings, such as registering a custom control and page language. These settings describe how the web forms (.aspx) or user controls (.ascx) pages are processed by the .Net framework.

The syntax for declaring a directive is:

<%@  directive_name attribute=value  [attribute=value]  %>
In this section, we will just introduce the ASP.NET directives and we will use most of these directives throughout the tutorials.


The Application Directive

The Application directive defines application-specific attributes. It is provided at the top of the global.aspx file.

The basic syntax of Application directive is:

<%@ Application Language="C#" %>

The Assembly Directive

The Assembly directive links an assembly to the page or the application at parse time. This could appear either in the global.asax file for application-wide linking, in the page file, a user control file for linking to a page or user control.

The basic syntax of Assembly directive is:

<%@ Assembly Name ="myassembly" %>

The Control Directive

The control directive is used with the user controls and appears in the user control (.ascx) files.

The basic syntax of Control directive is:

<%@ Control Language="C#"  EnableViewState="false" %>

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 implements directive is:

<%@ Implements  Interface="interface_name" %>


Some Others Are 

IMPORT DIRECTIVE

MASTER DIRECTIVE

MASTERTYPE DIRECTIVE

OUTPUTCACHE DIRECTIVE

PAGE DIRECTIVE

PREVIOUSPAGETYPE DIRECTIVE

REFERENCE DIRECTIVE

REGISTER DIRECTIVE

Comments

Post a Comment