PAGE DIRECTIVES. Page Directives  They are instructions, inserted at the top of an ASP.NET page, to control the behavior of ASP.NET pages.  So it is.

Slides:



Advertisements
Similar presentations
Master Pages, User Controls, Site Maps, Localization Svetlin Nakov Telerik Corporation
Advertisements

Java Script Session1 INTRODUCTION.
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
Working with ASP Pages. Slide 2 The Tag (1) Remember that most ASP.NET pages contain a single tag with the runat attribute set It’s possible to have multiple.
Anatomy of an ASP.NET Page. Slide 2 My Version of the Big Picture (1) ASP Worker (Engine) Your application Runs Server Other applications User 1User 2.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
1 Chapter 12 Working With Access 2000 on the Internet.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Basics of ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Installing ASP.NET and Web Matrix Data Types Branching Structure Procedures.
Web-Based Applications
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Introduction to ASP.NET
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Course Textbook: Build Your Own ASP.Net Website: Chapter 2
IT533 Lectures Configuring, Deploying, Tracing and Error Handling.
Web Forms. Agenda Web forms Web controls Code separation Dynamic compilation System.Web.UI.Page User controls.
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
4.1 JavaScript Introduction
Microsoft ASP.NET: An Overview of Caching Holly Mazerolle Developer Support Engineer Microsoft Developer Support Microsoft Corporation.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
Ch6:creating consistent looking web sites. Master pages Master page defines a combination of fixed content and content place holder to hold the web page(.aspx)
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
Overview of Previous Lesson(s) Over View  Server controls are small building blocks of the graphical user interface, which includes  Text boxes  Buttons.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Microsoft ASP.NET: An Overview of Caching. 2 Overview  Introduction to ASP.NET caching  Output caching  Data caching  Difference between Data Caching.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
ASP.NET Controls. Slide 2 Lecture Overview Identify the types of controls supported by ASP.NET and the differences between them.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Caching Chapter 12. Caching For high-performance apps Caching: storing frequently-used items in memory –Accessed more quickly Cached Web Form bypasses:
Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part.
COMP3241 E-Business Technologies Richard Henson University of Worcester October 2012.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
Overview of Previous Lesson(s) Over View  SDI programs  The Application Wizard can generate single-document interface (SDI) applications that work.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
ASP.NET OPTIMIZATION. Why Optimize? $$$ Whether you build applications for customers or not, enhanced applications save money.
Database Handling, Sessions, and AJAX. Post Back ASP.NET Functionality The IsPostBack method in ASP.NET is similar to the BlackBerry.refresh method –IsPostBack.
Anatomy of an ASP.NET Page. Slide 2 Compiling an ASP.NET Page An ASP.NET page is compiled when it is rendered for the first time A page is compiled to.
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
Christopher M. Pascucci.NET Programming CodeBehind.
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
Understanding Web Applications Lesson 4. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Web Page Development Understand Web.
Introduction to ASP.NET What is ASP.NET and how is different from ASP –ASP: server side technology for creating dynamic web pages using scripting languages.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
Svetlin Nakov Telerik Corporation
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
PostBack  When an initial request for a page (a Web Form) is received by ASP.NET, it locates and loads the requested Web Form (and if necessary compiles.
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
ASP.NET Part II Dr. Awad Khalil Computer Science Department AUC.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Sergey Sidorov PhD student, computer software chair Computer Science department.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
ASP.NET Architecture Mike Taulty Developer & Platform Group Microsoft Ltd
Creating a Web Page Lesson 1. Objectives HTML HTML is slowly being replaced by XHTML. XHTML stands for Extensible Hypertext Markup Language and is the.
ASP.NET Forms.
Anatomy of an ASP.NET Page
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
ASP.NET 2.0 Overview Created By: Ajay Bahoriya.
Presentation transcript:

PAGE DIRECTIVES

Page Directives  They are instructions, inserted at the top of an ASP.NET page, to control the behavior of ASP.NET pages.  So it is type of mixed settings related to how a page should render and processed.  There are 11 types of page directives in ASP.NET.  When used, directives can be located anywhere in an.aspx or.ascx file, though standard practice is to include them at the beginning of the file.  Each directive can contain one or more attributes(paired with values) that are specific to that directive.

@Page Directive  It enables you to specify attributes and values for an ASP.NET page to be used when the page is parsed and compiled.  Every.aspx files should include directive to execute. 

AttributeValues  AutoEventWireUpThe Boolean value that enables or disables Page events that are being automatically bound to methods; for example, Page_Load  BufferThe Boolean value that enables or disables HTTP response buffering  ClassNameClass name for the page  CodeFileName of the code behind file  DebugThe Boolean value that enables or disables compilation with debug symbols  EnableSessionStateEnables, disables or makes session state read-only  EnableViewStateThe Boolean value that enables or disables view state across page requests  ErrorPageURL for redirection if an unhandled page exception occurs

AttributeValues  InheritsThe name of the code behind or other class  LanguageProgramming language for code  SrcFile name of the code behind class  TraceEnables or disables tracing  TraceModeIndicates how trace messages are to be displayed - sorted by time or category

@Master Directive  Directive belongs to Master Pages i.e..master files.  The master page will be used in conjunction of any number of content pages.  So the content pages can inherit the attributes of the master page.  Directive has only fewer attributes as follows : Language – This attribute tells the complier about the language being used in the code – behind. AutoEventWireUp – For every page there is an automatic way to bind the events to methods in the same master file or in code behind. The default value is true. CodeFile – Specifies the code-behind file with which the Master page is associated.

Title – Sets the Master Page title. MasterPageFile – Specifies the location of the Master Page file to be used with the current Master Page. This is called Nested Master Page. EnableViewState Inherits 

@Control Directive  It is used when we build an ASP.NET user controls.  Directive helps us to define the properties to be inherited by the user control.  These values are assigned to the user control as the page is parsed and compiled. 

AttributeValues  AutoEventWireUpThe Boolean value that enables or disables automatic association of events to handlers  ClassNameFile name for the control  DebugThe Boolean value that enables or disables compilation with debug symbols  EnableViewStateThe Boolean value that enables or disables view state across page requests  ExplicitFor VB language, tells the compiler to use Option Explicit mode  InheritsThe class from which the control page inherits  LanguageLanguage for code and script  SrcFile name of the code behind class  StrictFor VB language, tells the compiler to use the Option Strict mode

@Register Directive  Directive associates aliases with namespaces and class names for notation in custom server control syntax.  This register the user control on the page so that the control can be accessed on the.aspx page by a specific name.  The main attributes Directive are : Assembly – The Assembly you are associating with the TagPrefix. Namespace – The namespace to relate with TagPrefix. Src – The location of the user control. TagName – The alias to relate to the class name.

TagPrefix – The alias to relate to the namespace. 

@Reference Directive  Directive declares that another ASP.NET page or user control should be compiled along with the current page or user control.  The main attributes Directive are : Control – User Control that ASP.NET should dynamically compile and link to the current page at run time. Page – The Web Form Page that ASP.NET page should dynamically compile and link to the current page at run time. VirtualPath – Specifies the location of the page or user control from which the active page will be referenced. 

@PreviousPageType Directive  It is a new directive that makes excellence in asp.net pages.  The concept of cross-page posting between ASP.NET pages is achieved by this directive.  This directive is used to specify the page from which the cross- page posting initiates. TypeName – Sets the name of the derived class from which the postback will occur. VirtualPath – Sets the location of the posting page from which the postback will occur. 

@OutputCache Directive  It controls the output caching policies of the ASP.NET page or user control.  You can even cache programmatically through code by using VB.NET or Visual C#.NET  The main attributes Directive are : Duration – The duration of time in seconds that the page or user control is cached. Location – To specify the location to store the output cache. To store the output cache on the browser client where the request originated set the value as “client”. To store the output cache on the web server, mention the location as “server”. VaryByParam – List of strings used to vary the output cache, separated with semi-colon.

VaryByControl – List of strings used to vary the output cache of a user control, separated with semi-colon. VaryByCustom – String of values, specifies the custom output caching requirements. VaryByHeader – List of HTTP headers used to vary the output cache, separated with semi-colon. 

@Import Directive  It allows you to specify any namespaces to be imported to the ASP.NET pages or user controls.  By importing, all the classes and interfaces of the namespace are made available to the page or user control. 

@Implements Directive  Directive gets the ASP.NET page to implement a specified.NET framework interface.  The only single attribute is Interface, helps to specify the.NET framework interface.  When the ASP.NET page or user control implements an interface, it has direct access to all its events, methods and properties. 

@Assembly Directive  Directive is used to make your ASP.NET page aware of external components.  This directive supports two attributes :- Name – Enables you to specify the name of an assembly you want to attach to the page. Here you should mention the filename without the extension. Src – Represents the name of a source code file. 

@MasterType Directive  To access members of a specific master page from a content page, you can create a strongly typed reference to the master page by creating directive. TypeName – Sets the name of the derived class from which to get strongly typed references or members. VirtualPath – Sets the location of the master page from which the strongly typed references and members will be retrieved.  If you have public properties defined in a master page that you’d like to access in a strongly-typed manner. You can add the MasterType directive into a page as shown :   this.Master.HeaderText = “Label updated using MasterType directive with VirtualPath attribute”