What are different types of directives in .NET ?



What are different types of directives in .NET ?..

Answer / bhim bharti

@Page: Defines page-specific attributes used by the ASP.NET page parser and compiler. Can be included only in .aspx files <%@ Page AspCompat="TRUE" language="C#" %>

@Control:Defines control-specific attributes used by the ASP.NET page parser and compiler. Can be included only in .ascx files. <%@ Control Language="VB" EnableViewState="false" %>

@Import: Explicitly imports a namespace into a page or user control. The Import directive cannot have more than one namespace attribute. To import multiple namespaces, use multiple @Import directives. <% @ Import Namespace="System.web" %>

@Implements: Indicates that the current page or user control implements the specified .NET framework interface.<%@ Implements Interface="System.Web.UI.IPostBackEventHandler" %>

@Register: Associates aliases with namespaces and class names for concise notation in custom server control syntax.<%@ Register Tagprefix="Acme" Tagname="AdRotator" Src="AdRotator.ascx" %>

@Assembly: Links an assembly to the current page during compilation, making all the assembly's classes and interfaces available for use on the page. <%@ Assembly Name="MyAssembly" %><%@ Assembly Src="MySource.vb" %>

@OutputCache: Declaratively controls the output caching policies of an ASP.NET page or a user control contained in a page<%@ OutputCache Duration="#ofseconds" Location="Any | Client | Downstream | Server | None" Shared="True | False" VaryByControl="controlname" VaryByCustom="browser | customstring" VaryByHeader="headers" VaryByParam="parametername" %>

@Reference: Declaratively indicates that another user control or page source file should be dynamically compiled and linked against the page in which this directive is declared.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

Tell me the code snippet to show how we can return 404 errors from HttpError?

0 Answers  


Which browsers support the xmlhttprequest object?

0 Answers  


Name the namespace which is used by ado.net?

0 Answers  


What is the significance of proxy user?

0 Answers   MCN Solutions,


What would be the salary of an Asp.net developer with 1 and half year experience in indian rupees..??

5 Answers  






Tell About Global.asax ?

3 Answers   Keane India Ltd,


Explain server-side scripting?

0 Answers  


What are ASP.NET Web Forms? How is this technology different than what is available though ASP (1.0-3.0)?

1 Answers  


differences between class inheritance and interface?

2 Answers  


i want to implement grid view value in paypal site. so how to create this code in asp.net with C#

0 Answers  


Explain security types in asp.net?

0 Answers  


can any one explain about 3-tier architecture and how to deploy 3 layers of 3-tier architecture in 3 different servers.plz send me .net code

1 Answers   Wipro,


Categories