How many Directives r in ASP.NET?

Answers were Sorted based on User's Feedback



How many Directives r in ASP.NET?..

Answer / ashish tiwari

There r 11 types directives in asp.net,

1)@ Assembly
Links an assembly to the current page or user control
declaratively.

2)@ Control
Defines control-specific attributes used by the ASP.NET
page parser and compiler and can be included only in .ascx
files (user controls).

3)@ Implements
Indicates that a page or user control implements a
specified .NET Framework interface declaratively.

4)@ Import
Imports a namespace into a page or user control explicitly.

5)@ Master
Identifies a page as a master page and defines attributes
used by the ASP.NET page parser and compiler and can be
included only in .master files.

6)@ MasterType
Defines the class or virtual path used to type the Master
property of a page.

7)@ OutputCache
Controls the output caching policies of a page or user
control declaratively.

8)@ Page
Defines page-specific attributes used by the ASP.NET page
parser and compiler and can be included only in .aspx files.

9)@ PreviousPageType
Creates a strongly typed reference to the source page from
the target of a cross-page posting.

10)@ Reference
Links a page, user control, or COM control to the current
page or user control declaratively.

11)@ Register
Associates aliases with namespaces and classes, which
allow user controls and custom server controls to be
rendered when included in a requested page or user control

Is This Answer Correct ?    37 Yes 4 No

How many Directives r in ASP.NET?..

Answer / rahultripathi

@assembly : - Link assembly to current Page or user control
directory .
@control :- Define control Spacific attributes to used
by ASP.Net page parser and compiler included only in .ascx
page.
@ Impliment : - Indicates that a page or user control
implements a specified .NET Framework interface
declaratively
@ import :- import a namespace in Page or user control
explicit.

@ Master :- Identifies a page as a master page and defines
attributes used by the ASP.NET page parser and compiler and
can be included only in .master files

@ Master Type:- Defining class or vartual Path used to type
master page property of page.

@OutPut Cache.
@Page.
@Privious Page Type.
@Reference .
@Register

Rahul Tripathi
rahltripathi@myway.com

Is This Answer Correct ?    23 Yes 4 No

How many Directives r in ASP.NET?..

Answer / aryan

11 directives are at your disposal in your ASP.NET pages or
User Control.

1)@Page:- The @Page Directive enables you to specify
attributes and values for an ASP.NET page(.aspx) to be used
when the page is parsed or compiled.

2)@Master:- The @Master Directive is quite similar to the
@Page directive except that the @Master directive is meant
for master page(.master). In using the @master directive,
you specify properties of the templated page that you'll be
using in conjunction with any number of content pages on
your site.

3)@Control:- This directive is used when you build an
ASP.NET user control. This control allows you to define the
properties to be inherited by the user control.

4)@Import:- This directive allows you to specify a
namespace to be imported into the ASP.NET page or user
control.This directive supports only a single attribute:
Namespace.

5)@Implements:-This directive gets the ASP.NET page to
implement a specified .NET Framework interface. This
directive supports only single attribute: Interface.

6)@Register:- This directive associates aliases with
namespaces and class names for notation in custom server
control syntax.This directive supports five attributes:
Assembly,Namespace,Src,TagName,TagPrefix.

7)@Assembly:- This directive attaches assemblies, the
building blocks of .NET applications, to an ASP.NET page or
user control as it compiles,thereby making all the
assembly's classes and interfaces available to the page.
This directive supports 2 attributes: Name and Src.

8)@PreviousPageType:- This directive is used to specify the
page from which any cross-page postings originate. This
directive supports two attributes: TypeName,VirtualPath.

9)@MasterType:- This directive associates a class name to
an ASP.NET page in order to get at strongly typed
references or members contained within the specified master
page. This directive supports two attributes:
TypeName,VirtualPath.

10)@OutputCache:- This directive controls the output
caching policies of an ASP.NET page or user control. This
directive supports the ten attributes:
CacheProfile,Duration,Location,NoStore,Shared,SqlDependency,
VaryByControl,VaryByCustom,VaryByHeader and VaryByParam.

11)@Reference:- This directive declares that another
ASP.NET page or user control should be compiled along with
the active page or control. This directive supports just a
single attribute: VirtualPath.


7)@Assembly

Is This Answer Correct ?    16 Yes 3 No

How many Directives r in ASP.NET?..

Answer / praveen

@ Assembly
Links an assembly to the current page or user control
declaratively.

@ Control
Defines control-specific attributes used by the ASP.NET
page parser and compiler and can be included only in .ascx
files (user controls).

@ Implements
Indicates that a page or user control implements a
specified .NET Framework interface declaratively.

@ Import
Imports a namespace into a page or user control explicitly.

@ Master
Identifies a page as a master page and defines attributes
used by the ASP.NET page parser and compiler and can be
included only in .master files.

@ MasterType
Defines the class or virtual path used to type the Master
property of a page.

@ OutputCache
Controls the output caching policies of a page or user
control declaratively.

@ Page
Defines page-specific attributes used by the ASP.NET page
parser and compiler and can be included only in .aspx files.

@ PreviousPageType
Creates a strongly typed reference to the source page from
the target of a cross-page posting.

@ Reference
Links a page, user control, or COM control to the current
page or user control declaratively.

@ Register
Associates aliases with namespaces and classes, which
allow user controls and custom server controls to be
rendered when included in a requested page or user control.

Is This Answer Correct ?    11 Yes 0 No

How many Directives r in ASP.NET?..

Answer / senthil kumar

assembly directive
register directive
page directive
implements directive
import directive

Is This Answer Correct ?    18 Yes 15 No

How many Directives r in ASP.NET?..

Answer / subhash

There is one more directive called @ WebHandler

Is This Answer Correct ?    3 Yes 2 No

How many Directives r in ASP.NET?..

Answer / shashank

There are one more directive in Page directives Application-global.asax

Is This Answer Correct ?    1 Yes 0 No

How many Directives r in ASP.NET?..

Answer / paresh rao + jignesh panchal

There 9 Directives in ASP.Net

Is This Answer Correct ?    8 Yes 22 No

Post New Answer

More ASP.NET Interview Questions

what is the differance between native code & managed code?

5 Answers   Microsoft,


What is the transport protocol you use to call a Web service?

2 Answers   Siebel Systems,


about view state and how validation controls will be executed on client and server

3 Answers   Wipro,


What are the disadvantages of view state / what are the benefits?

2 Answers   Siebel Systems,


what is postback implementation?when pre-render event n init event is fired?

2 Answers   Ness Technologies,






Define a web service in .net?

0 Answers  


What are the Types of session management in ASP.NET

0 Answers   Microsoft,


How is session id generated?

0 Answers  


What are HTTP handlers in ASP.NET?

0 Answers   MindCracker,


How does asp.net work?

0 Answers  


How can u handle Un Managed Code Exceptions in ASP.Net?

1 Answers   Lara Technology,


What does the "EnableViewState" property do? Why would I want it on or off?

3 Answers  


Categories