SlideShare a Scribd company logo
1 of 34
.Net Table of contents Introduction to VS 2005  Application and Page Frameworks  GUI Controls  Validation Server Controls  Working with Master Pages  Themes & Skins  Collections & Lists  Data Binding  Data Management with ADO.Net  Working with XML  Site Navigation  Security  State Management  Caching  Debugging & Error Handling  File I/O & Streams  Configurations
Introduction to VS 2005 Visual Studio 2005 is an IDE that is used to create ASPX pages (Web application) Creation of web application also creates a set of files. Web application exists only in the location specified by IIS virtual folder. In a system, the web root folder is //localhost This is the virtual folder The physical path for this virtual folder is inetpubwwroot
We can see these windows when we open the Visual Studio Property Window – Shows the properties of a control(Page or button or textbox) Solution Explorer – Shows the files that a opened project has Output Window – Shows the result of a compilation or execution of a program Error List – Shows the compilation errors etc. What can you find in a VS
IIS – Internet Information Services IIS is a web server that comes along with .Net We can configure IIS using “inetmgr” In the Start Menu, choose Run and type inetmgr. We will get a window that lists the websites present in the system. For creating a virtual directory, right click on the default website and select New -> Virtual Directory.  Give the alias name  Give the physical path Give the access permissions and click finish.
ASP .Net Used to create web applications and web services that run under IIS ASP.NET is a collection of .NET classes that collaborate to process an HTTP request and generate an HTTP response Helps us in creating Dynamic Web pages Dynamic web pages – Pages will be generated at the server based on the user’s request and then given back to the client (user)
ASP .Net Framework ASP.NET is a managed server-side framework  For building applications based on HTTP, HTML, XML and SOAP ASP.NET relies on IIS for an HTTP entry point ASP.NET supports building HTML-based Web Applications Based on ASP.NET pages, Web forms and server-side controls ASP.NET supports building Web Services Based on Web service classes and WebMethods
Life cycle of a web page Page_Init  This is called when page is initialized. We can declare some variables which need to be initialized before page is loaded Page_Load The server controls are loaded in the page .This event is called every time when page is loaded Control_Event This event is fired when control like button are clicked or changed Page_Unload This event occurs when a page is Unloaded from memory Page_Dispose This event occurs when a page is released from memory
Life cycle of a web application The Life of web application begins when a user requests for a page through the browser (client) When IIS receives request from client it calls ASP. NET  worker process The ASP.NET worker process loads the assembly  The executable creates an instance of web form Generates the HTML page to respond to the request Posts the response to browser  and then it destroys the instance of the web form Then browser receives the generated HTML
Client Performs tasks like button click The page’s data is sent back to server When server receives this page  it creates new instance of web form  Processes the event occurred Then again send back HTML and destroys the page When user stops the web application for a period of time session ends Life cycle of a web application (Contd..)
ASP .Net Advantages Executable portion of a web application are  compiled Enriched tool support Applications are based on CLR Common Language Runtime On the fly updates deployed without restarting server Better session management Integration with ADO.NET Built in features for caching Create XML Web services  Browser-independent Language-independent
Application and Page Framework
ASP .Net Applications ,[object Object]
Each application is contained within a physical directory
Each application runs in its own isolated AppDomain
Namespace must for this application is System.Web,[object Object]
ASP .Net Pages (Contd..) ASPX Page has <asp:Button id=“LookUp“ OnClick=btnSubmit_Click“ /> C# file will have btnSubmit_Click() { ... } The code behind page is inherited from System.Web.UI.Page class The .aspx file containing the user interface is inherited from code behind  class
Files in a Web application Project AssemblyInfo.cs  All the information about assembly including version, company name etc Default.aspx The visual description of a Web form.  Default.aspx.cs The code behind that responds to events on the Web form  Default.aspx.resx XML resources used by web form Global.asax  The global events that occur in web applications Web.config Configuration contents like authentication mode, error files etc.
GUI Controls
Server Control
Web Controls ListControl ListBox CheckBoxList Button Table WebControl System.Web.UI.Control System.Object TextBox ... ...
Postback event These events cause the web page to be sent back to the server for immediate processing When page is posted back ,the Page_Init, Page _Load events are handled  The page is submitted back and renders a new version of itself back to the user
Validation Controls ASP .Net provides 5 validation controls that are used to check the validity of data entered by the user in the server controls on the web page. Client side validation is also possible through a Jscript library WebUIValidation.js Required field validator Regular expression validator Compare validator Range validator Custom validator Validation summary
Required Field Validator To check whether a control contains data Properties: ControlToValidate ErrorMessage Text Method: Validate
Regular Expression Validator To check whether the entered data matches a specific format Properties ControlToValidate ValidationExpression ErrorMessage Method Validate
Compare Validator To compare values entered in two controls Properties: ControlToCompare ControlToValidate ErrorMessage ValueToCompare Method: Validate
Range Validator To compare whether the entered value is between two specified values Properties: ControlToValidate ErrorMessage Type MaximumValue MinimumValue Method: Validate
To Check the validity of an entered item using a client-side script or a server-side code, or both Properties: ControlToValidate ErrorMessage Events: ServerValidate Method: OnServerValidate Validate Custom Validator
To Display validation errors in a central location or display a general validation error description Properties: HeadText ShowMessageBox ShowSummary Validation Summary
We can create our own controls in addition to HTML and Web controls User controls offer you an easy way to partition and reuse common user interface (UI) functionality across your ASP.NET Web applications User controls are not compiled until run time You can simply drag and drop them on the page and start using them To create a user control: Add a new item ( select user control as a template)  and give it a name – Heading.ascx The following description can be seen in HTML view 	<%@Control Language="c#" AutoEventWireup="false" Codebehind="Heading.ascx.cs“> User Controls
To use a user control, just drag the ascx file from the solution explorer and drop it on the design area of the aspx page Or give like this in the html view of the aspx page In the head portion <%@Register TagPrefix="uc1" TagName="Heading" src="Heading.ascx"%> In the body portion <uc1 id=“user1”/> Using a User Control
The Calendar Web server control displays a traditional one-month calendar on your Web Forms pages Few properties: SelectedDate SelectedDates BackColor Few methods: AddDays() AddMonths() AddYears() GetMonth() GetYear() GetDayOfWeek() IsLeapYear() Calendar Control
DateTime is a static class. Members can be accessed via DateTime.Now and so on. The DateTime value type represents dates and times with values ranging from 12:00:00 midnight, January 1, 0001 Common Era to 11:59:59 P.M., December 31, 9999 C.E. Few properties: Today Now Date Few Methods: AddDays() AddMonths() Compare() ToLongDateString() ToShortDateString() DateTime
Full-featured list output Default is to show all columns Can specify a subset of columns to display Provides templates Standard  Custom Provides paging Provides data updates DataGrid Control
Provides simple output of list of items Templates provide the visual form It iterates over the bound data Display format of data is managed Does not support paging Provides templates for separators Does not provide data updates Repeater Control

More Related Content

What's hot (20)

Ch 04 asp.net application
Ch 04 asp.net application Ch 04 asp.net application
Ch 04 asp.net application
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
Asp .net web form fundamentals
Asp .net web form fundamentalsAsp .net web form fundamentals
Asp .net web form fundamentals
 
ASP.NET - Web Programming
ASP.NET - Web ProgrammingASP.NET - Web Programming
ASP.NET - Web Programming
 
Asp.net server control
Asp.net  server controlAsp.net  server control
Asp.net server control
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
ASP.NET User Controls - 20090828
ASP.NET User Controls - 20090828ASP.NET User Controls - 20090828
ASP.NET User Controls - 20090828
 
Asp.net controls
Asp.net controlsAsp.net controls
Asp.net controls
 
Asp
AspAsp
Asp
 
Ajax control tool kit
Ajax control tool kitAjax control tool kit
Ajax control tool kit
 
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl....net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
 
Ajax
AjaxAjax
Ajax
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
Csphtp1 20
Csphtp1 20Csphtp1 20
Csphtp1 20
 
Programming web application
Programming web applicationProgramming web application
Programming web application
 
ASP
ASPASP
ASP
 
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
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.net
 
.Net course-in-mumbai-ppt
.Net course-in-mumbai-ppt.Net course-in-mumbai-ppt
.Net course-in-mumbai-ppt
 
ASP.NET 4.0 Roadmap
ASP.NET 4.0 RoadmapASP.NET 4.0 Roadmap
ASP.NET 4.0 Roadmap
 

Similar to ASP.Net Presentation Part1

Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architectureIblesoft
 
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
 
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 questionsAkhil Mittal
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17Vivek chan
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04Vivek chan
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showSubhas Malik
 
Introductionto asp net-ppt
Introductionto asp net-pptIntroductionto asp net-ppt
Introductionto asp net-ppttmasyam
 
Aspnet architecture
Aspnet architectureAspnet architecture
Aspnet architecturephantrithuc
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applicationsDeepankar Pathak
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web ApplicationRishi Kothari
 
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 FormsSAMIR BHOGAYTA
 

Similar to ASP.Net Presentation Part1 (20)

Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
 
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
 
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
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
 
Asp dot net long
Asp dot net longAsp dot net long
Asp dot net long
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 
Introductionto asp net-ppt
Introductionto asp net-pptIntroductionto asp net-ppt
Introductionto asp net-ppt
 
Asp.net tips
Asp.net tipsAsp.net tips
Asp.net tips
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Aspnet architecture
Aspnet architectureAspnet architecture
Aspnet architecture
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applications
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
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
 
NET_Training.pptx
NET_Training.pptxNET_Training.pptx
NET_Training.pptx
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 

Recently uploaded

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Recently uploaded (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

ASP.Net Presentation Part1

  • 1. .Net Table of contents Introduction to VS 2005 Application and Page Frameworks GUI Controls Validation Server Controls Working with Master Pages Themes & Skins Collections & Lists Data Binding Data Management with ADO.Net Working with XML Site Navigation Security State Management Caching Debugging & Error Handling File I/O & Streams Configurations
  • 2. Introduction to VS 2005 Visual Studio 2005 is an IDE that is used to create ASPX pages (Web application) Creation of web application also creates a set of files. Web application exists only in the location specified by IIS virtual folder. In a system, the web root folder is //localhost This is the virtual folder The physical path for this virtual folder is inetpubwwroot
  • 3. We can see these windows when we open the Visual Studio Property Window – Shows the properties of a control(Page or button or textbox) Solution Explorer – Shows the files that a opened project has Output Window – Shows the result of a compilation or execution of a program Error List – Shows the compilation errors etc. What can you find in a VS
  • 4. IIS – Internet Information Services IIS is a web server that comes along with .Net We can configure IIS using “inetmgr” In the Start Menu, choose Run and type inetmgr. We will get a window that lists the websites present in the system. For creating a virtual directory, right click on the default website and select New -> Virtual Directory. Give the alias name Give the physical path Give the access permissions and click finish.
  • 5. ASP .Net Used to create web applications and web services that run under IIS ASP.NET is a collection of .NET classes that collaborate to process an HTTP request and generate an HTTP response Helps us in creating Dynamic Web pages Dynamic web pages – Pages will be generated at the server based on the user’s request and then given back to the client (user)
  • 6. ASP .Net Framework ASP.NET is a managed server-side framework For building applications based on HTTP, HTML, XML and SOAP ASP.NET relies on IIS for an HTTP entry point ASP.NET supports building HTML-based Web Applications Based on ASP.NET pages, Web forms and server-side controls ASP.NET supports building Web Services Based on Web service classes and WebMethods
  • 7. Life cycle of a web page Page_Init This is called when page is initialized. We can declare some variables which need to be initialized before page is loaded Page_Load The server controls are loaded in the page .This event is called every time when page is loaded Control_Event This event is fired when control like button are clicked or changed Page_Unload This event occurs when a page is Unloaded from memory Page_Dispose This event occurs when a page is released from memory
  • 8. Life cycle of a web application The Life of web application begins when a user requests for a page through the browser (client) When IIS receives request from client it calls ASP. NET worker process The ASP.NET worker process loads the assembly The executable creates an instance of web form Generates the HTML page to respond to the request Posts the response to browser and then it destroys the instance of the web form Then browser receives the generated HTML
  • 9. Client Performs tasks like button click The page’s data is sent back to server When server receives this page it creates new instance of web form Processes the event occurred Then again send back HTML and destroys the page When user stops the web application for a period of time session ends Life cycle of a web application (Contd..)
  • 10. ASP .Net Advantages Executable portion of a web application are compiled Enriched tool support Applications are based on CLR Common Language Runtime On the fly updates deployed without restarting server Better session management Integration with ADO.NET Built in features for caching Create XML Web services Browser-independent Language-independent
  • 11. Application and Page Framework
  • 12.
  • 13. Each application is contained within a physical directory
  • 14. Each application runs in its own isolated AppDomain
  • 15.
  • 16. ASP .Net Pages (Contd..) ASPX Page has <asp:Button id=“LookUp“ OnClick=btnSubmit_Click“ /> C# file will have btnSubmit_Click() { ... } The code behind page is inherited from System.Web.UI.Page class The .aspx file containing the user interface is inherited from code behind class
  • 17. Files in a Web application Project AssemblyInfo.cs All the information about assembly including version, company name etc Default.aspx The visual description of a Web form. Default.aspx.cs The code behind that responds to events on the Web form Default.aspx.resx XML resources used by web form Global.asax The global events that occur in web applications Web.config Configuration contents like authentication mode, error files etc.
  • 20. Web Controls ListControl ListBox CheckBoxList Button Table WebControl System.Web.UI.Control System.Object TextBox ... ...
  • 21. Postback event These events cause the web page to be sent back to the server for immediate processing When page is posted back ,the Page_Init, Page _Load events are handled The page is submitted back and renders a new version of itself back to the user
  • 22. Validation Controls ASP .Net provides 5 validation controls that are used to check the validity of data entered by the user in the server controls on the web page. Client side validation is also possible through a Jscript library WebUIValidation.js Required field validator Regular expression validator Compare validator Range validator Custom validator Validation summary
  • 23. Required Field Validator To check whether a control contains data Properties: ControlToValidate ErrorMessage Text Method: Validate
  • 24. Regular Expression Validator To check whether the entered data matches a specific format Properties ControlToValidate ValidationExpression ErrorMessage Method Validate
  • 25. Compare Validator To compare values entered in two controls Properties: ControlToCompare ControlToValidate ErrorMessage ValueToCompare Method: Validate
  • 26. Range Validator To compare whether the entered value is between two specified values Properties: ControlToValidate ErrorMessage Type MaximumValue MinimumValue Method: Validate
  • 27. To Check the validity of an entered item using a client-side script or a server-side code, or both Properties: ControlToValidate ErrorMessage Events: ServerValidate Method: OnServerValidate Validate Custom Validator
  • 28. To Display validation errors in a central location or display a general validation error description Properties: HeadText ShowMessageBox ShowSummary Validation Summary
  • 29. We can create our own controls in addition to HTML and Web controls User controls offer you an easy way to partition and reuse common user interface (UI) functionality across your ASP.NET Web applications User controls are not compiled until run time You can simply drag and drop them on the page and start using them To create a user control: Add a new item ( select user control as a template) and give it a name – Heading.ascx The following description can be seen in HTML view <%@Control Language="c#" AutoEventWireup="false" Codebehind="Heading.ascx.cs“> User Controls
  • 30. To use a user control, just drag the ascx file from the solution explorer and drop it on the design area of the aspx page Or give like this in the html view of the aspx page In the head portion <%@Register TagPrefix="uc1" TagName="Heading" src="Heading.ascx"%> In the body portion <uc1 id=“user1”/> Using a User Control
  • 31. The Calendar Web server control displays a traditional one-month calendar on your Web Forms pages Few properties: SelectedDate SelectedDates BackColor Few methods: AddDays() AddMonths() AddYears() GetMonth() GetYear() GetDayOfWeek() IsLeapYear() Calendar Control
  • 32. DateTime is a static class. Members can be accessed via DateTime.Now and so on. The DateTime value type represents dates and times with values ranging from 12:00:00 midnight, January 1, 0001 Common Era to 11:59:59 P.M., December 31, 9999 C.E. Few properties: Today Now Date Few Methods: AddDays() AddMonths() Compare() ToLongDateString() ToShortDateString() DateTime
  • 33. Full-featured list output Default is to show all columns Can specify a subset of columns to display Provides templates Standard Custom Provides paging Provides data updates DataGrid Control
  • 34. Provides simple output of list of items Templates provide the visual form It iterates over the bound data Display format of data is managed Does not support paging Provides templates for separators Does not provide data updates Repeater Control
  • 35. HeaderTemplate Rendered before all data bound rows ItemTemplate Rendered for each row in the data source AlternatingItemTemplate Rendered for every other row SeparatorTemplate Rendered between each row FooterTemplate Rendered after all data bound rows Standard templates for Repeater controls
  • 36. To bind embedded controls to the data source of the container control DataBinder.Eval() method is used Syntax <%#DataBinder.Eval(Container.DataItem,“DataFieldname")%> Container represents the container for data items DataFieldname represents the name of data item field Binding data