SlideShare a Scribd company logo
1 of 42
ASP.NET 4.0
Julie Iskander
MSC. Communication and Electronics
Lecture Outlines
   WebSite Design
    ◦ Master Page
    ◦ Themes and Skins
    ◦ Website Navigation
   ADO.NET Fundamentals
    ◦ Connected Model
    ◦ Disconnected Models
Website Design
“A Consistent Look and
Feel”
Master Page (.master)
 A templates that renders common
  appearance to all pages attached to it
 Rich design time support
 To work with them, we will create two
  types of pages
     MasterPages: a page template, contains
      controls and content placeholders
     ContentPages: references a single master
      page, to acquire layout, add page specific
      content in the content placeholders
.aspx                             .master

   In page                          All common HTML
    directive, MasterPageFile         tags, <html>,<head>,<bo
    = “masterpage url”                dy>
   Contain Content Control          All common controls
    that is linked to a certain      Contain
    ContentPlaceHolder in             ContentPlaceholder
    the master page                   Control  where the
   New content can be                page content will appear
    added only in the content
    control


         Master Page (.master)
Content Page
Convert from an HTML to an aspx page
Themes and skins
   What is the problem?
    ◦ To make control properties consistent, not just
      style properties
    ◦ To style complex controls like Calendar and
      Grids
   Themes:
    ◦   Are control-based, not HTML-based
    ◦   Are applied on the server
    ◦   Don’t cascade as in CSS
    ◦   Set in web.config or in each individual page
   Skins:
    ◦ Are text files with .skin extension
    ◦ Contains a list of control tags and set properties
      that need to be standardized
Themes and Skins
Convert from an HTML to an aspx page
Themes in Page Directive
Themes in web.config
Named Skins and SkinID




 What happens if all skins
 have IDs?
Themes and Skins
   Applying Themes dynamically:
    ◦ Page.Theme
    ◦ Page.StyleSheet
   This must be done in the PreInit event.
  Why????????????
 How to make a user
  change themes in his
  page?
ADO.NET
Fundamentals
ADO.NET
 Contains managed classes to connect to
  data sources (Relational DB), execute
  commands, manage disconnected data.
 It includes:
    ◦ Connection: establish connection to a
      DataSource.
    ◦ Command: execute SQL commands and stored
      procedures.
    ◦ DataReader: fast read-only, forward-only
      access.
    ◦ DataAdapter: fill DataSet from a DataSource, to
      apply changes to a DataSource, according to the
Connection class (implement
IDBConnection)
 A limited-server resource must be
  opened as late as possible and
  release it as quickly as possible.
 Connection String Stored in
  web.config
Connection class (implements
IDBConnection)
 To retrieve connection string
 Using System.Web.Configuration
Command Class (Implements
IDbCommand)
    Command class  to execute any
    type of SQL statement.
Command Methods
DataReader Class
 To read the data returned by a
  SELECT command one record at a
  time, in a forward-only, read-only
  stream.
 Provides the quickest possible access
  to data.
SQL Injection
SQL Injection Attacks
 The process of passing SQL code into
  an application, in a way that was not
  intended or anticipated by the
  application developer.
 Affects only applications that use SQL
  string building techniques to create a
  command with user-supplied values.
 Solution  use parameterized
  command or a stored procedure
Parameterized Commands
   A command that uses placeholders in
    the SQL text.
Convert from an HTML to an aspx page
Disconnected Model
   Using DataAdapters and DataSets
Disconnected Model
   Using DataSets you can:
    ◦ Work on multiple tables and relations
    ◦ Get ChildRows using the relations
    ◦ Search Tables by criteria using Select
      Method
   More in Pro ASP.NET 4 pages 340 -
    344
Convert from an HTML to an aspx page
Navigation Controls
(Self study in lab)
Site Map
   Add a web.sitemap
    ◦ XML file describing the site
Control Binding to a sitemap
   Controls to map to:
    ◦ SiteMap Path



    ◦ Menu
Reading Assignment #3
   Applying Themes Dynamically
Report #3
 How to dynamically set a MasterPage
  and in which state of the Page life
  cycle?
 What is a TreeView Control?
Lab #3
 Create masterpage.master for the
  site, with the date user control.
 Create three skins
  Default(green), Pink and Blue
  (StyleSheet, image and skin for image
  button)
 Add a sitemap to masterpage
 Add Home.aspx and Login.aspx
 Modify the three
  pages(register, books, checkout) to be
  able to use the master page
Lab #3
   In register.aspx
    ◦ Get the country and city from the
      database
   Bonus:
    ◦ Create modifyCities.aspx, using
      disconnected model insert, edit and
      delete cities.
Lab Hints
   Control ID problem with masterpage
    and css???
    ◦ Try ClientIDMode=static for page
Bonus
   Add a usercontrol to change
    themes, with the radiobuttons. Add it
    to the masterpage. How will it be
    applied to all pages????
REFERENCES

 [1] Beginning ASP.NET 4 In C# 2010, Matthew
  Macdonald, Apress
 [2] Web Application Architecture
  Principles, Protocols And Practices, Leon Shklar
  And Richard Rosen, Wiley
 [3] Professional AS P.NE T 4 In C# And VB, Bill
  Evjen, Scott Hanselman And Devin Rader, Wiley
 [4] Pro ASP.NET In C# 2010, Fourth
  Edition,matthew Macdonald, Adam Freeman, And
  Mario Szpuszta, Apress

More Related Content

What's hot

ASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites AppearanceASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites AppearanceRandy Connolly
 
ACTIVE SERVER PAGES BY SAIKIRAN PANJALA
ACTIVE SERVER PAGES BY SAIKIRAN PANJALAACTIVE SERVER PAGES BY SAIKIRAN PANJALA
ACTIVE SERVER PAGES BY SAIKIRAN PANJALASaikiran Panjala
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05Mani Chaubey
 
Gabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File ExampleGabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File Examplelinkedinsys
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...WebStackAcademy
 
Using js link and display templates
Using js link and display templatesUsing js link and display templates
Using js link and display templatesPaul Hunt
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauSpiffy
 
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 indiaJignesh Aakoliya
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!rommel_gagasa
 
SharePoint 2013 Client-Side Rendering (CSR) & JSLink Templates
SharePoint 2013 Client-Side Rendering (CSR) & JSLink TemplatesSharePoint 2013 Client-Side Rendering (CSR) & JSLink Templates
SharePoint 2013 Client-Side Rendering (CSR) & JSLink TemplatesMuawiyah Shannak
 
Building Cool apps with flex
Building Cool apps with flexBuilding Cool apps with flex
Building Cool apps with flexJoseph Khan
 
Introduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - ZaloniIntroduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - ZaloniJoseph Khan
 

What's hot (18)

Master pages
Master pagesMaster pages
Master pages
 
Master page in asp.net
Master page in asp.netMaster page in asp.net
Master page in asp.net
 
Master page
Master pageMaster page
Master page
 
ASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites AppearanceASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites Appearance
 
ACTIVE SERVER PAGES BY SAIKIRAN PANJALA
ACTIVE SERVER PAGES BY SAIKIRAN PANJALAACTIVE SERVER PAGES BY SAIKIRAN PANJALA
ACTIVE SERVER PAGES BY SAIKIRAN PANJALA
 
Jsp
JspJsp
Jsp
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
 
Gabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File ExampleGabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File Example
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...
 
Using js link and display templates
Using js link and display templatesUsing js link and display templates
Using js link and display templates
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
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
 
Final Presentation
Final PresentationFinal Presentation
Final Presentation
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
SharePoint 2013 Client-Side Rendering (CSR) & JSLink Templates
SharePoint 2013 Client-Side Rendering (CSR) & JSLink TemplatesSharePoint 2013 Client-Side Rendering (CSR) & JSLink Templates
SharePoint 2013 Client-Side Rendering (CSR) & JSLink Templates
 
Building Cool apps with flex
Building Cool apps with flexBuilding Cool apps with flex
Building Cool apps with flex
 
Introduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - ZaloniIntroduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - Zaloni
 

Viewers also liked (20)

Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Databind in asp.net
Databind in asp.netDatabind in asp.net
Databind in asp.net
 
State management
State managementState management
State management
 
JSP Custom Tags
JSP Custom TagsJSP Custom Tags
JSP Custom Tags
 
Simple Data Binding
Simple Data BindingSimple Data Binding
Simple Data Binding
 
WCF
WCFWCF
WCF
 
Windows Presentation Foundation
Windows Presentation Foundation  Windows Presentation Foundation
Windows Presentation Foundation
 
Ch 7 data binding
Ch 7 data bindingCh 7 data binding
Ch 7 data binding
 
State management
State managementState management
State management
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State management
 
State management in ASP.NET
State management in ASP.NETState management in ASP.NET
State management in ASP.NET
 
Web Navigation Presentation
Web Navigation PresentationWeb Navigation Presentation
Web Navigation Presentation
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTL
 
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag Library
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
Webservices
WebservicesWebservices
Webservices
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 

Similar to ASP.NET Lecture 3

Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Thomas Robbins
 
Asp.net With mvc handson
Asp.net With mvc handsonAsp.net With mvc handson
Asp.net With mvc handsonPrashant Kumar
 
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007Chandima Kulathilake
 
Blooming SharePoint Design
Blooming SharePoint DesignBlooming SharePoint Design
Blooming SharePoint DesignKathy Hughes
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to VisualforceSujit Kumar
 
11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16Vivek chan
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan Uzun
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET PresentationRasel Khan
 
Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Thomas Daly
 
Schaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site DefinitionsSchaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site Definitionsmferraz
 
Asp.net c# MVC-5 Training-Day-2 of Day-9
Asp.net c# MVC-5 Training-Day-2 of Day-9Asp.net c# MVC-5 Training-Day-2 of Day-9
Asp.net c# MVC-5 Training-Day-2 of Day-9AHM Pervej Kabir
 
Developing branding solutions
Developing branding solutionsDeveloping branding solutions
Developing branding solutionsThomas Daly
 

Similar to ASP.NET Lecture 3 (20)

ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
Asp.net With mvc handson
Asp.net With mvc handsonAsp.net With mvc handson
Asp.net With mvc handson
 
Mvc
MvcMvc
Mvc
 
Migration from ASP to ASP.NET
Migration from ASP to ASP.NETMigration from ASP to ASP.NET
Migration from ASP to ASP.NET
 
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
 
Blooming SharePoint Design
Blooming SharePoint DesignBlooming SharePoint Design
Blooming SharePoint Design
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to Visualforce
 
11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16
 
Session 1
Session 1Session 1
Session 1
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Developing Branding Solutions for 2013
Developing Branding Solutions for 2013
 
ASP.NET Lecture 6
ASP.NET Lecture 6ASP.NET Lecture 6
ASP.NET Lecture 6
 
Schaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site DefinitionsSchaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site Definitions
 
Web technologies part-2
Web technologies part-2Web technologies part-2
Web technologies part-2
 
Asp.net c# MVC-5 Training-Day-2 of Day-9
Asp.net c# MVC-5 Training-Day-2 of Day-9Asp.net c# MVC-5 Training-Day-2 of Day-9
Asp.net c# MVC-5 Training-Day-2 of Day-9
 
Developing branding solutions
Developing branding solutionsDeveloping branding solutions
Developing branding solutions
 

More from Julie Iskander

More from Julie Iskander (20)

HTML 5
HTML 5HTML 5
HTML 5
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
C for Engineers
C for EngineersC for Engineers
C for Engineers
 
Design Pattern lecture 3
Design Pattern lecture 3Design Pattern lecture 3
Design Pattern lecture 3
 
Scriptaculous
ScriptaculousScriptaculous
Scriptaculous
 
Prototype Framework
Prototype FrameworkPrototype Framework
Prototype Framework
 
Design Pattern lecture 4
Design Pattern lecture 4Design Pattern lecture 4
Design Pattern lecture 4
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
 
Design Pattern lecture 1
Design Pattern lecture 1Design Pattern lecture 1
Design Pattern lecture 1
 
Ajax and ASP.NET AJAX
Ajax and ASP.NET AJAXAjax and ASP.NET AJAX
Ajax and ASP.NET AJAX
 
jQuery
jQueryjQuery
jQuery
 
ASP.NET Lecture 5
ASP.NET Lecture 5ASP.NET Lecture 5
ASP.NET Lecture 5
 
ASP.NET lecture 8
ASP.NET lecture 8ASP.NET lecture 8
ASP.NET lecture 8
 
ASP.NET Lecture 7
ASP.NET Lecture 7ASP.NET Lecture 7
ASP.NET Lecture 7
 
AJAX and JSON
AJAX and JSONAJAX and JSON
AJAX and JSON
 
Object Oriented JavaScript
Object Oriented JavaScriptObject Oriented JavaScript
Object Oriented JavaScript
 
DOM and Events
DOM and EventsDOM and Events
DOM and Events
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
HTML and CSS part 3
HTML and CSS part 3HTML and CSS part 3
HTML and CSS part 3
 
HTML and CSS part 2
HTML and CSS part 2HTML and CSS part 2
HTML and CSS part 2
 

Recently uploaded

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 

Recently uploaded (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

ASP.NET Lecture 3

  • 1. ASP.NET 4.0 Julie Iskander MSC. Communication and Electronics
  • 2. Lecture Outlines  WebSite Design ◦ Master Page ◦ Themes and Skins ◦ Website Navigation  ADO.NET Fundamentals ◦ Connected Model ◦ Disconnected Models
  • 4. Master Page (.master)  A templates that renders common appearance to all pages attached to it  Rich design time support  To work with them, we will create two types of pages  MasterPages: a page template, contains controls and content placeholders  ContentPages: references a single master page, to acquire layout, add page specific content in the content placeholders
  • 5. .aspx .master  In page  All common HTML directive, MasterPageFile tags, <html>,<head>,<bo = “masterpage url” dy>  Contain Content Control  All common controls that is linked to a certain  Contain ContentPlaceHolder in ContentPlaceholder the master page Control  where the  New content can be page content will appear added only in the content control Master Page (.master)
  • 6.
  • 8. Convert from an HTML to an aspx page
  • 9. Themes and skins  What is the problem? ◦ To make control properties consistent, not just style properties ◦ To style complex controls like Calendar and Grids  Themes: ◦ Are control-based, not HTML-based ◦ Are applied on the server ◦ Don’t cascade as in CSS ◦ Set in web.config or in each individual page  Skins: ◦ Are text files with .skin extension ◦ Contains a list of control tags and set properties that need to be standardized
  • 11. Convert from an HTML to an aspx page
  • 12. Themes in Page Directive
  • 14. Named Skins and SkinID What happens if all skins have IDs?
  • 15. Themes and Skins  Applying Themes dynamically: ◦ Page.Theme ◦ Page.StyleSheet  This must be done in the PreInit event. Why????????????  How to make a user change themes in his page?
  • 17. ADO.NET  Contains managed classes to connect to data sources (Relational DB), execute commands, manage disconnected data.  It includes: ◦ Connection: establish connection to a DataSource. ◦ Command: execute SQL commands and stored procedures. ◦ DataReader: fast read-only, forward-only access. ◦ DataAdapter: fill DataSet from a DataSource, to apply changes to a DataSource, according to the
  • 18. Connection class (implement IDBConnection)  A limited-server resource must be opened as late as possible and release it as quickly as possible.  Connection String Stored in web.config
  • 19. Connection class (implements IDBConnection)  To retrieve connection string  Using System.Web.Configuration
  • 20. Command Class (Implements IDbCommand)  Command class  to execute any type of SQL statement.
  • 22. DataReader Class  To read the data returned by a SELECT command one record at a time, in a forward-only, read-only stream.  Provides the quickest possible access to data.
  • 23.
  • 25. SQL Injection Attacks  The process of passing SQL code into an application, in a way that was not intended or anticipated by the application developer.  Affects only applications that use SQL string building techniques to create a command with user-supplied values.  Solution  use parameterized command or a stored procedure
  • 26. Parameterized Commands  A command that uses placeholders in the SQL text.
  • 27. Convert from an HTML to an aspx page
  • 28. Disconnected Model  Using DataAdapters and DataSets
  • 29.
  • 30. Disconnected Model  Using DataSets you can: ◦ Work on multiple tables and relations ◦ Get ChildRows using the relations ◦ Search Tables by criteria using Select Method  More in Pro ASP.NET 4 pages 340 - 344
  • 31. Convert from an HTML to an aspx page
  • 33. Site Map  Add a web.sitemap ◦ XML file describing the site
  • 34.
  • 35. Control Binding to a sitemap  Controls to map to: ◦ SiteMap Path ◦ Menu
  • 36. Reading Assignment #3  Applying Themes Dynamically
  • 37. Report #3  How to dynamically set a MasterPage and in which state of the Page life cycle?  What is a TreeView Control?
  • 38. Lab #3  Create masterpage.master for the site, with the date user control.  Create three skins Default(green), Pink and Blue (StyleSheet, image and skin for image button)  Add a sitemap to masterpage  Add Home.aspx and Login.aspx  Modify the three pages(register, books, checkout) to be able to use the master page
  • 39. Lab #3  In register.aspx ◦ Get the country and city from the database  Bonus: ◦ Create modifyCities.aspx, using disconnected model insert, edit and delete cities.
  • 40. Lab Hints  Control ID problem with masterpage and css??? ◦ Try ClientIDMode=static for page
  • 41. Bonus  Add a usercontrol to change themes, with the radiobuttons. Add it to the masterpage. How will it be applied to all pages????
  • 42. REFERENCES  [1] Beginning ASP.NET 4 In C# 2010, Matthew Macdonald, Apress  [2] Web Application Architecture Principles, Protocols And Practices, Leon Shklar And Richard Rosen, Wiley  [3] Professional AS P.NE T 4 In C# And VB, Bill Evjen, Scott Hanselman And Devin Rader, Wiley  [4] Pro ASP.NET In C# 2010, Fourth Edition,matthew Macdonald, Adam Freeman, And Mario Szpuszta, Apress

Editor's Notes

  1. One way is by creating a template page that inherits System.Web.UI.Page, and use it as a parent to all other pagesVS Design doen’t support that
  2. When a page with masterpage is requested, the master page must be rendered and merged with the page contents to create a single final, page to be rendered to the response
  3. Master Directive
  4. MasterPage.masterDefault.aspxTry writing outside of content holder see errorSee designer
  5. If a property is specified in a theme and in the individual control, the theme overrides all other
  6. Theme a folder contains css and skins
  7. Try creating theme folder and add stylesTry creating skins for a calendar controlNo skin designer support, copy and past controls from pages after setting itTry cascading effect (theme vs. styesheettheme)
  8. Only controls with the skinID will apply the skin
  9. After PreInitthrow an exception because after preinit controls are createdTheme changes aren’t read until page reload and passed PreInitstageuseServer.Transfer to refresh to itself.
  10. Standardized ADO.NET through depending on a number of interfaces and base classes.
  11. Connection.Close equivalent to connection.Dispose()
  12. ADO.Net page
  13. ADO.Net page