SlideShare a Scribd company logo
ASP.NET 2.0  Overview
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) All Binary 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=&quot;MainContentPlaceHolder&quot; runat=&quot;server&quot;> < / 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=&quot;server&quot; ForeColor=&quot;Blue&quot; Font--Names=&quot;Verdana&quot; Font-Size=&quot;Small&quot;/>
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=&quot;text/JavaScript&quot;> <!-- WebForm_AutoFocus('ctl00_MainContentPlaceHolder_ddlName');// --> </script> Setting default button (for Enter Key) Panel.DefaultButton Designates button to be &quot;clicked&quot; 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. <asp:Button ID=&quot;btnThemes&quot; runat=server Text=&quot;Themes and Skins&quot; PostBackUrl=&quot;~/Personal.aspx&quot;/> Referencing Previous Page’s Controls Using  PreviousPage  object. PreviousPage.IsCrossPagePostBack Weak Typing PreviousPage .FindControl() Strong Typing <%@ PreviousPageType VirtualPath=&quot;~/Default.aspx&quot; %> 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

More Related Content

What's hot (20)

PPTX
ASP.NET 5 Overview: Post RTM
Shahed Chowdhuri
 
PPTX
ASP.NET 5 Overview for Apex Systems
Shahed Chowdhuri
 
PPTX
ASP.NET 5 Overview - Post Build 2015
Shahed Chowdhuri
 
PPTX
ASP.NET Lecture 1
Julie Iskander
 
PPTX
New Features of ASP.NET 4.0
Buu Nguyen
 
PPTX
SharePoint Development with the SharePoint Framework
JoAnna Cheshire
 
PPTX
Introduction to ASP.NET
Rajkumarsoy
 
PPTX
Angular on ASP.NET MVC 6
Noam Kfir
 
PPT
single page application
Ravindra K
 
PDF
White Paper : ASP.NET Core AngularJs 2 and Prime
Hamida Rebai Trabelsi
 
DOC
Asp.Net Tutorials
Ram Sagar Mourya
 
PPT
ASP.NET Tutorial - Presentation 1
Kumar S
 
DOC
Tutorial asp.net
Vivek K. Singh
 
PPTX
Master page in Asp.net
RupinderjitKaur9
 
PPTX
Migrando una app de angular.js a Blazor
Miguel Angel Teheran Garcia
 
PPTX
Usability AJAX and other ASP.NET Features
Peter Gfader
 
PPTX
Lightning Web Component - LWC
Thierry TROUIN ☁
 
PPTX
ASP.NET Brief History
Sudhakar Sharma
 
PPTX
SharePoint Framework - Developer Preview
Sean McLellan
 
PPTX
Gabriel Gayhart - XML Pointer File Example
linkedinsys
 
ASP.NET 5 Overview: Post RTM
Shahed Chowdhuri
 
ASP.NET 5 Overview for Apex Systems
Shahed Chowdhuri
 
ASP.NET 5 Overview - Post Build 2015
Shahed Chowdhuri
 
ASP.NET Lecture 1
Julie Iskander
 
New Features of ASP.NET 4.0
Buu Nguyen
 
SharePoint Development with the SharePoint Framework
JoAnna Cheshire
 
Introduction to ASP.NET
Rajkumarsoy
 
Angular on ASP.NET MVC 6
Noam Kfir
 
single page application
Ravindra K
 
White Paper : ASP.NET Core AngularJs 2 and Prime
Hamida Rebai Trabelsi
 
Asp.Net Tutorials
Ram Sagar Mourya
 
ASP.NET Tutorial - Presentation 1
Kumar S
 
Tutorial asp.net
Vivek K. Singh
 
Master page in Asp.net
RupinderjitKaur9
 
Migrando una app de angular.js a Blazor
Miguel Angel Teheran Garcia
 
Usability AJAX and other ASP.NET Features
Peter Gfader
 
Lightning Web Component - LWC
Thierry TROUIN ☁
 
ASP.NET Brief History
Sudhakar Sharma
 
SharePoint Framework - Developer Preview
Sean McLellan
 
Gabriel Gayhart - XML Pointer File Example
linkedinsys
 

Similar to Asp.Net 2.0 Presentation (20)

PPT
Asp.net architecture
Iblesoft
 
PPT
Asp.net
Naveen Sihag
 
PPT
Intro To Asp Net And Web Forms
SAMIR BHOGAYTA
 
PPT
How to develop asp web applications
Deepankar Pathak
 
PPT
Developing an ASP.NET Web Application
Rishi Kothari
 
PPT
Aspnet2 Overview
ajitbergi
 
PPTX
Code model
teach4uin
 
PDF
Introductionto asp net-ppt
tmasyam
 
DOC
Asp.Net Page Life
guest812990
 
PDF
Asp.Net 3 5 Part 1
asim78
 
PDF
ASP.NET Interview Questions PDF By ScholarHat
Scholarhat
 
DOCX
Tutorial 1
Aravindharamanan S
 
PPTX
Chapter 5
application developer
 
PDF
Asp.net web page syntax overview
Salam Khan
 
PPTX
Introduction to ASP.NET
Peter Gfader
 
PPS
01 asp.net session01
Mani Chaubey
 
PPSX
03 asp.net session04
Vivek Singh Chandel
 
PPT
Introduction to ASP.net. It provides basic introduction
ssuserbf6ebe
 
PPT
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
AvijitChaudhuri3
 
Asp.net architecture
Iblesoft
 
Asp.net
Naveen Sihag
 
Intro To Asp Net And Web Forms
SAMIR BHOGAYTA
 
How to develop asp web applications
Deepankar Pathak
 
Developing an ASP.NET Web Application
Rishi Kothari
 
Aspnet2 Overview
ajitbergi
 
Code model
teach4uin
 
Introductionto asp net-ppt
tmasyam
 
Asp.Net Page Life
guest812990
 
Asp.Net 3 5 Part 1
asim78
 
ASP.NET Interview Questions PDF By ScholarHat
Scholarhat
 
Tutorial 1
Aravindharamanan S
 
Asp.net web page syntax overview
Salam Khan
 
Introduction to ASP.NET
Peter Gfader
 
01 asp.net session01
Mani Chaubey
 
03 asp.net session04
Vivek Singh Chandel
 
Introduction to ASP.net. It provides basic introduction
ssuserbf6ebe
 
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
AvijitChaudhuri3
 
Ad

Recently uploaded (20)

PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Ad

Asp.Net 2.0 Presentation

  • 1. ASP.NET 2.0 Overview
  • 2. Agenda Web development using Visual Studio Page Inheritance model Deployment model Master Pages Themes Miscellaneous Summary Questions
  • 3. 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.
  • 4. 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.
  • 5. 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 { ... } }
  • 6. 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; ... } }
  • 7. 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 = &quot;Hello there &quot; + _nameTextBox.Text + &quot;!&quot;; } } }
  • 8. 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) All Binary 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)
  • 9. 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
  • 10. Deployment Model Contd… Command Line: Aspnet_compiler Path: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 Usage: aspnet_compiler.exe -v /web -p &quot;D: \Apoorv\Tutorial\ASP.NET 2.0\Master Pages and Themes\web&quot; c:\deploy UI (VS2005): Build -> Publish Web Site Strong Naming possible during publishing.
  • 11. 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.
  • 12. 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.
  • 13. Master Pages contd… <%@ Master %> tag denotes Master page. <asp:contentplaceholder id=&quot;MainContentPlaceHolder&quot; runat=&quot;server&quot;> < / 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.
  • 14. 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=&quot;server&quot; ForeColor=&quot;Blue&quot; Font--Names=&quot;Verdana&quot; Font-Size=&quot;Small&quot;/>
  • 15. 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=&quot;text/JavaScript&quot;> <!-- WebForm_AutoFocus('ctl00_MainContentPlaceHolder_ddlName');// --> </script> Setting default button (for Enter Key) Panel.DefaultButton Designates button to be &quot;clicked&quot; when Enter is pressed with focus in panel <asp:Panel DefaultButton=“Button ID”….
  • 16. 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
  • 17. Miscellaneous contd… E.g. <asp:Button ID=&quot;btnThemes&quot; runat=server Text=&quot;Themes and Skins&quot; PostBackUrl=&quot;~/Personal.aspx&quot;/> Referencing Previous Page’s Controls Using PreviousPage object. PreviousPage.IsCrossPagePostBack Weak Typing PreviousPage .FindControl() Strong Typing <%@ PreviousPageType VirtualPath=&quot;~/Default.aspx&quot; %> PreviousPage .<<Property>>
  • 18. 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
  • 19. References For Page Inheritance and Deployment Model http://west-wind.com/weblog/posts/3016.aspx http://msdn.microsoft.com/msdnmag/issues/06/01/ExtremeASPNET/