How many Directives r in ASP.NET?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
assembly directive
register directive
page directive
implements directive
import directive
| Is This Answer Correct ? | 18 Yes | 15 No |
Answer / subhash
There is one more directive called @ WebHandler
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / shashank
There are one more directive in Page directives Application-global.asax
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / paresh rao + jignesh panchal
There 9 Directives in ASP.Net
| Is This Answer Correct ? | 8 Yes | 22 No |
What is the basic purpose of the required field validator? How can you use a required field validator to check that the user changes the initial value of a text box? a listbox?
Define transparent caching with aop?
Project Architecture (3tier, n-tier)
Which browsers support the xmlhttprequest object?
Explain how do you validate the controls in an asp .net page?
What is the latest version of asp.net?
Will session work if cookies is disabled?
What is the server of asp.net?
Any disadvantages in Dataset and in reflection ?
WHAT IS THE SEQUENCE IN WHICH ASP.NET EVENTS IS PROCEED?
What is mvc in angular?
What tags do you need to add within the asp:datagrid tags to bind columns manually
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)