ASP.NET 2.0 Overview Created By: Ajay Bahoriya.

Slides:



Advertisements
Similar presentations
Malek Kemmou Technology Architect, Application Platform Microsoft Middle East and Africa Overview of ASP.NET 2.0.
Advertisements

Unit 02. ASP.NET Introduction HTML & Server controls Postbacks Page Lifecycle.
Master Pages, User Controls, Site Maps, Localization Svetlin Nakov Telerik Corporation
IT533 Lectures Validation Controls, User Controls, Master Pages.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
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.
Asp.NET Page Composition. Slide 2 Lecture Overview Work with master pages and content pages.
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.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Web-Based Applications
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Introduction to ASP.NET
Web Forms. Agenda Web forms Web controls Code separation Dynamic compilation System.Web.UI.Page User controls.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
Introduction to.Net and ASP.Net Course Introduction Build Your Own ASP.Net Website: Chapter 1 Microsoft ASP.Net Walkthrough: Creating a Basic Web Forms.
Preview of ASP.NET 2.0 in Delphi Course #3182 Jim Tierney Principal Engineer - Borland.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
INSPIRING CREATIVE AND INNOVATIVE MINDS Module 4: Adding Code to a Microsoft ASP.NET Web Form Implementing Code-Behind Pages Adding Event Procedures to.
© 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 application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Managing Look, Feel, and Layout with Visual Studio 2005 and ASP.NET 2.0.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Unit 3: Adding Code to a Microsoft ASP.NET Web Form.
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,
WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation.
VITALE, CATURANO & COMPANY LTD Microsoft SharePoint Web Part Development Overview VITALE, CATURANO & COMPANY LTD SharePoint Developer Series – Web Part.
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.
Christopher M. Pascucci.NET Programming CodeBehind.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Microsoft ® Official Course Developing a Publishing Site for Web Content Microsoft SharePoint 2013 SharePoint Practice.
Migrating from ASP.NET 1.1 to ASP.NET 2.0 Scott Guthrie Web Platform and Tools Team Microsoft Corporation
WEB322 ASP.NET Internals: Under the Covers – Exploring Internals, Page Lifecycle and the Compilation Model Simon Calvert Program Manager Web Platform and.
Web Development in Microsoft Visual Studio 2013 / 2015.
1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
11 Getting Started with ASP.NET Beginning ASP.NET in C# and VB Chapters 1 and 2.
1111 Master Pages Beginning ASP.NET in C# and VB Chapter 6.
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
11 User Controls Beginning ASP.NET in C# and VB Chapter 8.
Developer Exam Preparation Thom Robbins Bryan Soltis
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
Chapter 2 Creating Website with Web Forms. Objectives Understand the different project types and templates when building ASP.NET web sites. The different.
Creating Consistent Looking Websites
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
Computing with C# and the .NET Framework
ASP.NET Forms.
Working with ASP.NET Master Pages.
Project Objectives Publish to a remote server
Introduction to ASP.NET 2.0
Using ASP.NET Master Pages
Chapter 8 User Controls.
Florida Gulf Coast University
Haritha Dasari Josue Balandrano Coronel -
Web Development in Microsoft Visual Studio 2013
Anatomy of an ASP.NET Page
ASP.NET Module Subtitle.
Static and Dynamic Web Pages
ASP.NET.
Web Development Using ASP .NET
Master Pages & Themes.
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
Server Controls Validation Controls
Introduction to ASP.NET Parts 1 & 2
Presentation transcript:

ASP.NET 2.0 Overview Created By: Ajay Bahoriya

Agenda Web development using Visual Studio Page Inheritance model Deployment model Master Pages Themes Miscellaneous Summary Questions

Web development using Visual Studio Directory Based Project System Model Edit any web anywhere (no project file required) No longer required to build entire site into a single DLL Can now re-build just individual pages to test and run HTML Source Preservation Tool will never re-format or mangle your code Intellisense Everywhere Code Behind Inline Code Better code separation using folder hierarchies App_Code, App_LocalResources, etc.

Page Inheritance model How does ASP.NET 1.1 model works? You have Code Behind file that contains all the control declarations along with code. HTML Markup is contained in the ASPX page. Compilation – ASPX page s compiled into a class that inherits from code behind class. Problems with the above model? Every time a change is made in ASPX page, InitializeComponent section had to be regenerated. Try removing a control from ASPX page, most of the time VS2003 does not cleans up the code.

Page Inheritance model contd … ASP.NET 2.0: New code-behind model Works using Partial Classes Uses CodeFile attribute instead of CodeBehind No need to explicit declaration of controls in code behind class. So how does this works? Class for ASPX file generated by ASP.NET namespace ASP { public class default_aspx : MsdnMag.Default ... }

Page Inheritance model contd … Sibling partial class generated by ASP.NET namespace MsdnMag { public partial class Default : IRequiresSessionState protected TextBox _nameTextBox; protected Button _enterButton; protected Label _messageLabel; private HtmlForm form1; ... }

Page Inheritance model contd … Codebehind partial class that you write namespace MsdnMag { public partial class Default : Page void _enterButton_Click(object sender, EventArgs e) _messageLabel.Text = "Hello there " + _nameTextBox.Text + "!"; }

Deployment Model ASP.NET 2.0 comes up with new deployment modes All Binary All Source Updateable (Source Code in binary and ASPX files in source) Both Source Code and ASPX are compiled into binary. Each folder is compiled into separate Assembly. The ASPX pages present are just marker files and does NOT contain any code. PrecompiledApp.config – contains version and update mode (as False)

Deployment Model Contd… Updateable Source Code is compiled into binary ASPX files remain “as is”. Each folder is compiled into separate Assembly The ASPX pages present contain actual code. PrecompiledApp.config – contains version and update mode (as True) Source Code Source Code deployed “as is” Compiled during first hit and then cached Advantage – any code changes take effect immediately

Deployment Model Contd… Command Line: Aspnet_compiler Path: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 Usage: aspnet_compiler.exe -v /web -p "D: \Apoorv\Tutorial\ASP.NET 2.0\Master Pages and Themes\web" c:\deploy UI (VS2005): Build -> Publish Web Site Strong Naming possible during publishing.

Deployment Model Contd… Assembly Generation and pitfalls Each folder is compiled into separate assembly. E.g. Folder Hierarchy Admin – Admin1.aspx, Admin1.aspx.cs Assembly1 - Admin2.aspx, Admin2.aspx.cs Mobile – Mobile1.aspx, Mobile1.aspx.cs Assembly2 - Mobile2.aspx, Mobile2.aspx.cs This may cause your site to fail with change in deployment mode. Need to realize that classes are generated at runtime If the Page and the dynamically referenced UserControl (e.g. using LoadControl) are in different page, by default you cannot access the UserControl programmatically. Need to use <%@ Register %> tag on the page to refer to the userControl.

Master Pages Visual Inheritance for Web Pages .master file contains template used by all pages in the application. Other pages are contained as controls in the Master page. Content Place Holders Define where custom content will be placed. Can define default content. Can have multiple place holders per page. Design support in Visual Studio .NET 2005.

Master Pages contd… <%@ Master %> tag denotes Master page. <asp:contentplaceholder id="MainContentPlaceHolder" runat="server"> </asp:contentplaceholder> tag denotes the place holder for the contents. Content Page Specify the Master page using the “MasterPageFile” attribute in the <%@ Page %> tag. <asp:Content ContentPlaceHolderID=MainContentPlaceHolder ID=mainContent runat=server>CONTENTS </asp:Content> - contents are placed within above tag. Nesting of master pages is also possible.

Themes Personalization of Web Pages Works using .skin files Place .skin file in App_Themes folder Set the Theme property on the page. Can be set using “Theme” attribute of <%@ Page %> tag Can set Theme property programmatically as well. Has to be done on or before the Page_PreInit Sample .skin file <asp:Label Runat="server" ForeColor="Blue" Font--Names="Verdana" Font-Size="Small"/>

Miscellaneous Lets look at some more features provided by ASP.NET 2.0 Setting default focus Page.SetFocus() Java Script rendered on browser is: <script type="text/JavaScript"> <!-- WebForm_AutoFocus('ctl00_MainContentPlaceHolder_ddlName');// --> </script> Setting default button (for Enter Key) Panel.DefaultButton Designates button to be "clicked" when Enter is pressed with focus in panel <asp:Panel DefaultButton=“Button ID”….

Miscellaneous contd… Cross Page Posting Pages can now post back to other pages Relevant properties: control.PostBackUrl - Identifies postback target Page.PreviousPage - Returns reference to page that originated a cross-page postback PreviousPage.IsCrossPagePostBack - Reveals whether a cross-page postback occurred @ PreviousPageType directive provides strongly typed access to previous page Reference previous page control in the new page

Miscellaneous contd… E.g. Referencing Previous Page’s Controls <asp:Button ID="btnThemes" runat=server Text="Themes and Skins" PostBackUrl="~/Personal.aspx"/> Referencing Previous Page’s Controls Using PreviousPage object. PreviousPage.IsCrossPagePostBack Weak Typing PreviousPage.FindControl() Strong Typing <%@ PreviousPageType VirtualPath="~/Default.aspx" %> PreviousPage.<<Property>>

Summary New Page Inheritance Model in ASP.NET 2.0 Various Deployment Modes available with .NET 2.0 Master Page for consistent UI Web page / site personalization using Themes. Various controls / features available to reduce coding efforts

References For Page Inheritance and Deployment Model http://west-wind.com/weblog/posts/3016.aspx http://msdn.microsoft.com/msdnmag/issues/06/01/ExtremeASPNET/

Questions