SlideShare a Scribd company logo
Directives in ASP.NET
Brought to you by
• 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#" %>
Attributes Description
Inherits The name of the class from which to inherit.
Description The text description of the application. Parsers and
compilers ignore this.
Language The language used in code blocks.
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" %>
Attributes Description
Name The name of the assembly to be linked.
Src The path to the source file to be linked and compiled
dynamically.
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" %>
Attributes Description
AutoEventWireup The Boolean value that enables or disables automatic association of events to
handlers.
ClassName The file name for the control.
Debug The Boolean value that enables or disables compiling with debug symbols.
Description The text description of the control page, ignored by compiler.
EnableViewState The Boolean value that indicates whether view state is maintained across
page requests.
Explicit For VB language, tells the compiler to use option explicit mode.
Inherits The class from which the control page inherits.
Language The language for code and script.
Src The filename for the code-behind class.
Strict For VB language, tells the compiler to use the option strict mode.
• 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" %>
• The Import Directive
• The Import directive imports a namespace into a web page, user control page of
application. If the Import directive is specified in the global.asax file, then it is applied
to the entire application. If it is in a page of user control page, then it is applied to
that page or control.
• The basic syntax for import directive is:
• <%@ namespace="System.Drawing" %>
• The Master Directive
• The Master directive specifies a page file as being the mater page.
• The basic syntax of sample MasterPage directive is:
• <%@ MasterPage Language="C#" AutoEventWireup="true"
CodeFile="SiteMater.master.cs" Inherits="SiteMaster" %>
• The MasterType Directive
• The MasterType directive assigns a class name to the Master property of a
page, to make it strongly typed.
• The basic syntax of MasterType directive is:
• <%@ MasterType attribute="value"[attribute="value" ...] %>
• The OutputCache Directive
• The OutputCache directive controls the output caching policies of a web page
or a user control.
• The basic syntax of OutputCache directive is:
• <%@ OutputCache Duration="15" VaryByParam="None" %>
• The Page Directive
• The Page directive defines the attributes specific to the page file for the page
parser and the compiler.
• The basic syntax of Page directive is:
• <%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" Trace="true" %>
Attributes Description
AutoEventWireup The Boolean value that enables or disables page events that are being
automatically bound to methods; for example, Page_Load.
Buffer The Boolean value that enables or disables HTTP response buffering.
ClassName The class name for the page.
ClientTarget The browser for which the server controls should render content.
CodeFile The name of the code behind file.
Debug The Boolean value that enables or disables compilation with debug
symbols.
Description The text description of the page, ignored by the parser.
EnableSessionState It enables, disables, or makes session state read-only.
EnableViewState The Boolean value that enables or disables view state across page
requests.
ErrorPage URL for redirection if an unhandled page exception occurs.
Inherits The name of the code behind or other class.
Language The programming language for code.
Src The file name of the code behind class.
Trace It enables or disables tracing.
TraceMode It indicates how trace messages are displayed, and sorted by time or
category.
Transaction It indicates if transactions are supported.
ValidateRequest The Boolean value that indicates whether all input data is validated
against a hardcoded list of values.
• The PreviousPageType Directive
• The PreviousPageType directive assigns a class to a page, so that the page is strongly typed.
• The basic syntax for a sample PreviousPagetype directive is:
• <%@ PreviousPageType attribute="value"[attribute="value" ...] %>
• The Reference Directive
• The Reference directive indicates that another page or user control should be compiled and linked to the
current page.
• The basic syntax of Reference directive is:
• <%@ Reference Page ="somepage.aspx" %>
• The Register Directive
• The Register derivative is used for registering the custom server controls and user controls.
• The basic syntax of Register directive is:
• <%@ Register Src="~/footer.ascx" TagName="footer" TagPrefix="Tfooter" %>
Thank You
For more updates subscribe to our YouTube channel
SIRYMEDIA
To watch more videos visit our website
www.sirymedia.in

More Related Content

What's hot

Life cycle-of-a-thread
Life cycle-of-a-threadLife cycle-of-a-thread
Life cycle-of-a-thread
javaicon
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
priya Nithya
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
Arzath Areeff
 
android activity
android activityandroid activity
android activityDeepa Rani
 
Functions in javascript
Functions in javascriptFunctions in javascript
Awt, Swing, Layout managers
Awt, Swing, Layout managersAwt, Swing, Layout managers
Awt, Swing, Layout managers
swapnac12
 
Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)
Timbal Mayank
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions
Reem Alattas
 
Abstract class in java
Abstract class in javaAbstract class in java
Abstract class in java
Lovely Professional University
 
Php array
Php arrayPhp array
Php array
Nikul Shah
 
ASP.NET - Directives
ASP.NET - DirectivesASP.NET - Directives
ASP.NET - Directives
Dhammapal Kamble
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and Interface
Haris Bin Zahid
 
شرح مقرر البرمجة 2 لغة جافا - مادة النهائي
شرح مقرر البرمجة 2   لغة جافا - مادة النهائيشرح مقرر البرمجة 2   لغة جافا - مادة النهائي
شرح مقرر البرمجة 2 لغة جافا - مادة النهائي
جامعة القدس المفتوحة
 
java graphics
java graphicsjava graphics
java graphics
nilaykarade1
 
Abstract class
Abstract classAbstract class
Abstract class
Tony Nguyen
 
Understanding java streams
Understanding java streamsUnderstanding java streams
Understanding java streamsShahjahan Samoon
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
babak danyal
 
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
Dr.Neeraj Kumar Pandey
 

What's hot (20)

Life cycle-of-a-thread
Life cycle-of-a-threadLife cycle-of-a-thread
Life cycle-of-a-thread
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
 
android activity
android activityandroid activity
android activity
 
Functions in javascript
Functions in javascriptFunctions in javascript
Functions in javascript
 
Awt, Swing, Layout managers
Awt, Swing, Layout managersAwt, Swing, Layout managers
Awt, Swing, Layout managers
 
Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions
 
Abstract class in java
Abstract class in javaAbstract class in java
Abstract class in java
 
Vectors in Java
Vectors in JavaVectors in Java
Vectors in Java
 
Php array
Php arrayPhp array
Php array
 
ASP.NET - Directives
ASP.NET - DirectivesASP.NET - Directives
ASP.NET - Directives
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and Interface
 
شرح مقرر البرمجة 2 لغة جافا - مادة النهائي
شرح مقرر البرمجة 2   لغة جافا - مادة النهائيشرح مقرر البرمجة 2   لغة جافا - مادة النهائي
شرح مقرر البرمجة 2 لغة جافا - مادة النهائي
 
java graphics
java graphicsjava graphics
java graphics
 
Difference between association, aggregation and composition
Difference between association, aggregation and compositionDifference between association, aggregation and composition
Difference between association, aggregation and composition
 
Abstract class
Abstract classAbstract class
Abstract class
 
Understanding java streams
Understanding java streamsUnderstanding java streams
Understanding java streams
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
 

Viewers also liked

Harish Understanding Aspnet
Harish Understanding AspnetHarish Understanding Aspnet
Harish Understanding Aspnetrsnarayanan
 
Skillwise - Advanced web application development
Skillwise - Advanced web application developmentSkillwise - Advanced web application development
Skillwise - Advanced web application development
Skillwise Group
 
Technical screening .Net Developer
Technical screening  .Net DeveloperTechnical screening  .Net Developer
Technical screening .Net Developer
Tom Henricksen
 
Asp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationAsp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentation
abhishek singh
 
Introducing asp.net web pages 2
Introducing asp.net web pages 2Introducing asp.net web pages 2
Introducing asp.net web pages 2
Uh-meet Thapa
 
Ch 04 asp.net application
Ch 04 asp.net application Ch 04 asp.net application
Ch 04 asp.net application Madhuri Kavade
 
Custom controls
Custom controlsCustom controls
Custom controlsaspnet123
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
Hitesh Santani
 
ASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewStateASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewState
Mindfire Solutions
 
ASP.NET Web Security
ASP.NET Web SecurityASP.NET Web Security
ASP.NET Web Security
SharePointRadi
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
Abhishek Sur
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
SAMIR BHOGAYTA
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
Ido Flatow
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
Arun Prasad
 
ASPX Session xi(page lifecycle)
ASPX Session xi(page lifecycle)ASPX Session xi(page lifecycle)
ASPX Session xi(page lifecycle)
Shrijan Tiwari
 

Viewers also liked (20)

Harish Understanding Aspnet
Harish Understanding AspnetHarish Understanding Aspnet
Harish Understanding Aspnet
 
Skillwise - Advanced web application development
Skillwise - Advanced web application developmentSkillwise - Advanced web application development
Skillwise - Advanced web application development
 
Technical screening .Net Developer
Technical screening  .Net DeveloperTechnical screening  .Net Developer
Technical screening .Net Developer
 
ASP.NET - Web Programming
ASP.NET - Web ProgrammingASP.NET - Web Programming
ASP.NET - Web Programming
 
Asp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationAsp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentation
 
Introducing asp.net web pages 2
Introducing asp.net web pages 2Introducing asp.net web pages 2
Introducing asp.net web pages 2
 
Ch 04 asp.net application
Ch 04 asp.net application Ch 04 asp.net application
Ch 04 asp.net application
 
Custom controls
Custom controlsCustom controls
Custom controls
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
ASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewStateASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewState
 
Ch3 server controls
Ch3 server controlsCh3 server controls
Ch3 server controls
 
ASP.NET Web Security
ASP.NET Web SecurityASP.NET Web Security
ASP.NET Web Security
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
ASPX Session xi(page lifecycle)
ASPX Session xi(page lifecycle)ASPX Session xi(page lifecycle)
ASPX Session xi(page lifecycle)
 

Similar to Directives in asp.net

JSP Directives
JSP DirectivesJSP Directives
JSP Directives
ShahDhruv21
 
Overview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company indiaOverview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company india
Jignesh Aakoliya
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSPGeethu Mohan
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
Shah Nawaz Bhurt
 
AEM Sightly Deep Dive
AEM Sightly Deep DiveAEM Sightly Deep Dive
AEM Sightly Deep Dive
Gabriel Walt
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to Visualforce
Sujit Kumar
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance TopicsAli Taki
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
Akhil Mittal
 
MVC by asp.net development company in india
MVC by asp.net development company in indiaMVC by asp.net development company in india
MVC by asp.net development company in india
iFour Institute - Sustainable Learning
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
Buu Nguyen
 
Asp.net With mvc handson
Asp.net With mvc handsonAsp.net With mvc handson
Asp.net With mvc handson
Prashant Kumar
 
Implementing java server pages standard tag library v2
Implementing java server pages standard tag library v2Implementing java server pages standard tag library v2
Implementing java server pages standard tag library v2
Soujanya V
 
A View about ASP .NET and their objectives
A View about ASP .NET and their objectivesA View about ASP .NET and their objectives
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
Rami Nayan
 
Web api
Web apiWeb api
Web api
udaiappa
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
yuvalb
 
SCWCD : Java server pages CHAP : 9
SCWCD : Java server pages  CHAP : 9SCWCD : Java server pages  CHAP : 9
SCWCD : Java server pages CHAP : 9
Ben Abdallah Helmi
 

Similar to Directives in asp.net (20)

JSP Directives
JSP DirectivesJSP Directives
JSP Directives
 
Overview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company indiaOverview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company india
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
AEM Sightly Deep Dive
AEM Sightly Deep DiveAEM Sightly Deep Dive
AEM Sightly Deep Dive
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to Visualforce
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 
Mvc
MvcMvc
Mvc
 
MVC by asp.net development company in india
MVC by asp.net development company in indiaMVC by asp.net development company in india
MVC by asp.net development company in india
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
Asp.net With mvc handson
Asp.net With mvc handsonAsp.net With mvc handson
Asp.net With mvc handson
 
Implementing java server pages standard tag library v2
Implementing java server pages standard tag library v2Implementing java server pages standard tag library v2
Implementing java server pages standard tag library v2
 
A View about ASP .NET and their objectives
A View about ASP .NET and their objectivesA View about ASP .NET and their objectives
A View about ASP .NET and their objectives
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Migration from ASP to ASP.NET
Migration from ASP to ASP.NETMigration from ASP to ASP.NET
Migration from ASP to ASP.NET
 
Web api
Web apiWeb api
Web api
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
SCWCD : Java server pages CHAP : 9
SCWCD : Java server pages  CHAP : 9SCWCD : Java server pages  CHAP : 9
SCWCD : Java server pages CHAP : 9
 

More from Sireesh K

Cn10
Cn10Cn10
Cn10
Sireesh K
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
Sireesh K
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
Sireesh K
 
What is mvc
What is mvcWhat is mvc
What is mvc
Sireesh K
 
31c
31c31c
31cs
31cs31cs
31cs
Sireesh K
 
45c
45c45c
44c
44c44c
43c
43c43c
42c
42c42c
41c
41c41c
40c
40c40c
39c
39c39c
38c
38c38c
37c
37c37c
35c
35c35c
34c
34c34c
33c
33c33c
30c
30c30c
29c
29c29c

More from Sireesh K (20)

Cn10
Cn10Cn10
Cn10
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
What is mvc
What is mvcWhat is mvc
What is mvc
 
31c
31c31c
31c
 
31cs
31cs31cs
31cs
 
45c
45c45c
45c
 
44c
44c44c
44c
 
43c
43c43c
43c
 
42c
42c42c
42c
 
41c
41c41c
41c
 
40c
40c40c
40c
 
39c
39c39c
39c
 
38c
38c38c
38c
 
37c
37c37c
37c
 
35c
35c35c
35c
 
34c
34c34c
34c
 
33c
33c33c
33c
 
30c
30c30c
30c
 
29c
29c29c
29c
 

Recently uploaded

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 

Recently uploaded (20)

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 

Directives in asp.net

  • 2. • 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#" %>
  • 3. Attributes Description Inherits The name of the class from which to inherit. Description The text description of the application. Parsers and compilers ignore this. Language The language used in code blocks.
  • 4. 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" %>
  • 5. Attributes Description Name The name of the assembly to be linked. Src The path to the source file to be linked and compiled dynamically.
  • 6. 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" %>
  • 7. Attributes Description AutoEventWireup The Boolean value that enables or disables automatic association of events to handlers. ClassName The file name for the control. Debug The Boolean value that enables or disables compiling with debug symbols. Description The text description of the control page, ignored by compiler. EnableViewState The Boolean value that indicates whether view state is maintained across page requests. Explicit For VB language, tells the compiler to use option explicit mode. Inherits The class from which the control page inherits. Language The language for code and script. Src The filename for the code-behind class. Strict For VB language, tells the compiler to use the option strict mode.
  • 8. • 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" %> • The Import Directive • The Import directive imports a namespace into a web page, user control page of application. If the Import directive is specified in the global.asax file, then it is applied to the entire application. If it is in a page of user control page, then it is applied to that page or control. • The basic syntax for import directive is: • <%@ namespace="System.Drawing" %>
  • 9. • The Master Directive • The Master directive specifies a page file as being the mater page. • The basic syntax of sample MasterPage directive is: • <%@ MasterPage Language="C#" AutoEventWireup="true" CodeFile="SiteMater.master.cs" Inherits="SiteMaster" %> • The MasterType Directive • The MasterType directive assigns a class name to the Master property of a page, to make it strongly typed. • The basic syntax of MasterType directive is: • <%@ MasterType attribute="value"[attribute="value" ...] %>
  • 10. • The OutputCache Directive • The OutputCache directive controls the output caching policies of a web page or a user control. • The basic syntax of OutputCache directive is: • <%@ OutputCache Duration="15" VaryByParam="None" %> • The Page Directive • The Page directive defines the attributes specific to the page file for the page parser and the compiler. • The basic syntax of Page directive is: • <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Trace="true" %>
  • 11. Attributes Description AutoEventWireup The Boolean value that enables or disables page events that are being automatically bound to methods; for example, Page_Load. Buffer The Boolean value that enables or disables HTTP response buffering. ClassName The class name for the page. ClientTarget The browser for which the server controls should render content. CodeFile The name of the code behind file. Debug The Boolean value that enables or disables compilation with debug symbols. Description The text description of the page, ignored by the parser.
  • 12. EnableSessionState It enables, disables, or makes session state read-only. EnableViewState The Boolean value that enables or disables view state across page requests. ErrorPage URL for redirection if an unhandled page exception occurs. Inherits The name of the code behind or other class. Language The programming language for code. Src The file name of the code behind class. Trace It enables or disables tracing. TraceMode It indicates how trace messages are displayed, and sorted by time or category. Transaction It indicates if transactions are supported. ValidateRequest The Boolean value that indicates whether all input data is validated against a hardcoded list of values.
  • 13. • The PreviousPageType Directive • The PreviousPageType directive assigns a class to a page, so that the page is strongly typed. • The basic syntax for a sample PreviousPagetype directive is: • <%@ PreviousPageType attribute="value"[attribute="value" ...] %> • The Reference Directive • The Reference directive indicates that another page or user control should be compiled and linked to the current page. • The basic syntax of Reference directive is: • <%@ Reference Page ="somepage.aspx" %> • The Register Directive • The Register derivative is used for registering the custom server controls and user controls. • The basic syntax of Register directive is: • <%@ Register Src="~/footer.ascx" TagName="footer" TagPrefix="Tfooter" %>
  • 14. Thank You For more updates subscribe to our YouTube channel SIRYMEDIA To watch more videos visit our website www.sirymedia.in