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

detail code for sql data connections?

2 Answers  


Why web api is better than wcf?

0 Answers  


Are xaml file compiled or built on runtime?

0 Answers  


What is the difference between visual basic and asp.net?

0 Answers  


What is asp short for?

0 Answers  


What are the steps involved to fill a dataset?

0 Answers  


Name and describe some HTTP Status Codes and what they express to the requesting client ?

1 Answers  


What is difference between Server.Transfer and Response.Redirect in ASP.NET?

0 Answers   Sans Pareil IT Services,


33) You create English, French, and German versions of your ASP.NET application. You have separate resource files for each language version. You need to deploy the appropriate resource file based on the language settings of the server. What should you do? A . Create an installer and set the Installer.Context property for each version of your application. B . Create an installer that has a launch condition to verify the locale settings. C . Create an installer that has a custom action to install only location-specific files. D . Create an installer that has an MsiConfigureProduct function to install the appropriate version.

2 Answers   Friedkin, ISH, Syntax, Syntax Softtech,


Explain Optimization technique description?

0 Answers   Digital GlobalSoft,


In which module you have worked in your .net project explain?

1 Answers   TechSolution,


A brief difference between Session and Cookies in asp.net

5 Answers   HCL, HCL Comnet,


Categories