SlideShare a Scribd company logo
2
Day - 1
3
What is ASP.NET?
 It is a web development platform provided by Microsoft.
 It is used for creating web-based applications.
 ASP.Net applications can also be written in a variety of .Net languages like C#, VB.Net, and J#.
 ASP stands for Active Server Pages, and .NET is Network Enabled Technologies.
What are the prerequisites to learn .NET?
 Basic Computer Operating knowledge.
 Commonsense
4
ASP.NET Architecture and its Components
 A variety of languages exists for .net framework. They are
VB.net and C#.
 These can be used to develop web applications.
 Has a set of standard class libraries.
 The most used library for web applications is
the Web library.
 Web library has all the necessary components
used to develop web-based applications
 It is a platform on which the .Net programs are executed
 Used for performing key activities like Exception handling and
Garbage collection.
5
key characteristics of the ASP.Net framework
 Code Behind Mode
 Separates Code from the Design
 State Management
 To maintain the state of the application
 Caching
 To manage quick user access to the application
6
ASP.Net Lifecycle
Start Object Creation
HTTP
Application
Creation
Dispose End
 Request is made by a user to the Web server for the ASP.Net Application.
 Application_start method is executed by the web server.
 All the global variables are set to their default values.
 Creation of the HttpContext, HttpRequest & HttpResponse by the web server.
 HttpContext is the container for the HttpRequest and HttpResponse objects.
 HttpRequest object contains information about the current request, including cookies and browser information.
 HttpResponse object contains the response that is sent to the client.
 This object is created by the web server.
 It is used to process each subsequent request sent to the application.
 This event is called before the application instance is destroyed.
 Most commonly used to manually release any unmanaged resources.
 The application is finally unloaded from memory.
7
ASP.Net Page Lifecycle
 When an ASP.Net page is called, it goes through a particular lifecycle.
 This is done before the response is sent to the user.
 When the page is requested from the server, the
server checks if it is requested for the first time.
 If so, then it needs to compile the page, parse the
response and send it across to the user.
 If it is not the first time the page is requested, the
cache is checked to see if the page output exists.
 If so, that response is sent to the user.
 At this stage, 2 objects [Request and Response] are
created.
 Request object is used to hold all the information
which was sent when the page was requested.
 Response object is used to hold the information
which is sent back to the user.
 At this stage, all the controls on a web page is
initialized.
 So, if there are any label, textbox or any other
controls on the web form, they all will get
initialized.
 This is when the page is loaded with all the default
values.
 So, if a textbox is supposed to have a default value,
that value is loaded during the page load time.
 Validations are performed on the form elements.
 This event is triggered if the same page is being loaded
again.
 This happens in response to an earlier event. Sometimes
there can be a situation that a user clicks on a submit button
on the page.
 In this case, the same page is displayed again. In such a case,
the Postback event handler is called.
 This happens just before all the response information is sent
to the user.
 All the information on the form is saved, and the result is
sent to the user as a complete web page.
 Once the page output is sent to the user, the unloading
process starts removing all unwanted objects from memory.
8
Day - 2
9
Adding ASP.Net Controls to Web Forms
 ASP.Net has the ability to add controls to a form such as textboxes and labels.
 Label Control
 The label control is used to display a text or a message to the user on the form.
 The label control is normally used along with other controls.
 The label gives an indication to the user on what is expected to be done in the other control.
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
 Textbox
 A text box is used for allowing a user to enter some text on the Web form application.
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
 List box
 A Listbox is used to showcase a list of items on the Web form.
<asp:ListBox ID="ListBox1" runat="server"></asp:ListBox>
10
Adding ASP.Net Controls to Web Forms
 RadioButton
 A Radio button is used to showcase a list of items out of which the user can choose one.
<asp:RadioButton ID="RadioButton1" runat="server" />
 Checkbox
 A checkbox is used to provide a list of options in which the user can choose multiple choices.
<asp:CheckBox ID="CheckBox1" runat="server" />
 Button
 A button is used to allow the user to click on a button which would then start the processing of the form.
<asp:Button ID="Button1" runat="server" Text="Button" />
11
Event Handling in ASP.Net
 When working with a web form, you can add events to controls.
 An event is something that happens when an action is performed.
 The most common action is the clicking of a button on a form.
 This code can be used to perform certain actions when a button is pressed on the form.
 This is generally the most common event in Web Forms.
12
ASP.NET Session Management
 The HTTP protocol on which all web applications work is a stateless protocol.
 It means that information is not retained from one request to another.
 In ASP.Net, the data is passed on to next page using
 ViewState.
 Session Object
View State
 This is wherein ASP.Net automatically stores the contents of all the controls.
 It also ensures this is passed onto the next page.
 This is done via a property called the ViewState.
Note:
It is not ideal for a developer to change anything in the view state. This is because it should be handled by
ASP.Net only.
13
Session Object
 The Session object is available throughout the lifecycle of the application.
 You can store any number of key-value pairs in the Session object.
 So on any page, you can store a value in the Session object via the below line of code
Session["Key"]=value
Note:
It is not ideal for a developer to change anything in the view state. This is because it should be handled by
ASP.Net only.
14
Day - 3
15
Connecting to Database
 Key Terminologies
 Connection
 To work with the data in a database, the first step is the connection.
 It consists of the below-mentioned parameters.
 Database name or Data Source – The first important parameter is the database name. Each connection can
only work with one database at a time.
 Credentials – The next important aspect is the 'username' and 'password'. This is used to establish a
connection to the database.
 Optional parameters - You can specify optional parameters on how .net should handle the connection to
the database. For example, one can specify a parameter for how long the connection should stay active.
 Selecting data from the database
 Once the connection is established, data is fetched from the database.
 ASP.Net has the ability to execute 'sql' select command against the database.
 The 'sql' statement can be used to fetch data from a specific table in the database.
 Inserting data into the database
 ASP.Net is used to insert records into the database.
 Values for each row that needs to be inserted in the database are specified in ASP.Net.
16
Connecting to Database
 Key Terminologies
 Updating data into the database
 New values can be specified in ASP.Net for each row that needs to be updated into the database.
 Deleting data from a database
 The code is written to delete a particular row from the database.
17
Day - 4
18
Level Tracing, Debugging, Error Handling and Unit Testing
What is Debugging
 It is the process of adding breakpoints to an application.
 These breakpoints are used to pause the execution of a running program.
 This allows the developer to understand what is happening in a program at a particular point in time.
Application Tracing
 Application tracing allows one to see if any pages requested results in an error.
 When tracing is enabled, an extra page called trace.axd is added to the application.
 This page will show all the requests and their status.
<trace enable="true" pageOutput="false" requestLimit="40" localOnly="false"/>
Page Level Tracing
 Page tracing shows all the general information about a web page when it is being processed.
 This is useful in debugging if a page does not work for any reason.
 Visual Studio will provide detailed information about various aspects of the page.
 This information is displayed when the application run's in Visual Studio.
19
Level Tracing, Debugging, Error Handling and Unit Testing
Page Level Tracing
 Page tracing shows all the general information about a web page when it is being processed.
 This is useful in debugging if a page does not work for any reason.
 Visual Studio will provide detailed information about various aspects of the page.
 This information is displayed when the application run's in Visual Studio.
Error Handling: Displaying a Custom Error Page
Steps for Custom Error Page:
 Add the HTML page to display a custom error.
 Update the web.config file with the customErrors tag
 <customErrors mode="On" defaultRedirect="ErrorPage.html"> </customErrors>
 Create the code with error .aspx.cs
20
Day - 5
21
ASP.NET MVC
What is ASP.NET MVC
 It is an open source web development framework from Microsoft that provides a Model View Controller
architecture.
 ASP.net MVC offers an alternative to ASP.net web forms for building web applications.
 It is a part of the .Net platform for building, deploying and running web apps.
 You can develop web apps and website with the help of HTML, CSS, jQuery, Javascript, etc.
 MVC stands for Model, View, and Controller.
 MVC separates an application into three components - Model, View, and Controller
Model:
Model represents the shape of the data.
A class in C# is used to describe a model.
Model objects store data retrieved from the database.
Model represents the data.
22
ASP.NET MVC
Model:
View in MVC is a user interface.
View display model data to the user and also enables them to modify them.
View in ASP.NET MVC is HTML, CSS, and some special syntax (Razor syntax) that makes it easy to communicate with
the model and the controller.
View is the User Interface.
Controller:
The controller handles the user request.
Typically, the user uses the view and raises an HTTP request, which will be handled by the controller.
The controller processes the request and returns the appropriate view as a response.
Controller is the request handler.
23
ASP.NET MVC Architecture
24
ASP.NET MVC Working Principle
25
Create ASP.NET MVC Application
26
Create ASP.NET MVC Application
27
ASP.NET MVC Folder Structure
28
ASP.NET MVC Folder Structure
App_Data
• The App_Data folder can contain application data files like LocalDB, .mdf files, XML files, and other data related files.
• IIS will never serve files from App_Data folder.
App_Start
• The App_Start folder can contain class files that will be executed when the application starts.
• Typically, these would be config files like AuthConfig.cs, BundleConfig.cs, FilterConfig.cs, RouteConfig.cs etc.
29
ASP.NET MVC Folder Structure
Content
• The Content folder contains static files like CSS files, images, and icons files.
• MVC 5 application includes bootstrap.css, bootstrap.min.css, and Site.css by default.
30
ASP.NET MVC Folder Structure
Content
• The Content folder contains static files like CSS files, images, and icons files.
• MVC 5 application includes bootstrap.css, bootstrap.min.css, and Site.css by default.
31
ASP.NET MVC Folder Structure
Controllers
• The Controllers folder contains class files for the controllers.
• A Controller handles users' request and returns a response.
• MVC requires the name of all controller files to end with "Controller".
32
ASP.NET MVC Folder Structure
fonts
• The Fonts folder contains custom font files for your application.
33
ASP.NET MVC Folder Structure
fonts
• The Fonts folder contains custom font files for your application.
34
ASP.NET MVC Folder Structure
Models
• The Models folder contains model class files.
• Typically, model class includes public properties, which will be used by the application to hold and manipulate
application data.
35
ASP.NET MVC Folder Structure
Scripts
• The Scripts folder contains JavaScript or VBScript files for the application.
• MVC 5 includes javascript files for bootstrap, jquery 1.10, and modernizer by default.
36
ASP.NET MVC Folder Structure
Views
• The Views folder contains HTML files for the application.
• Typically view file is a .cshtml file where you write HTML and C# or VB.NET code.
• The Views folder includes a separate folder for each controller.
• The Shared folder under the View folder contains all the views shared among different controllers e.g., layout files.
37
ASP.NET MVC Folder Structure
Global.asax
• Global.asax file allows you to write code that runs in response to application-level events, such as
Application_BeginRequest, application_start, application_error, session_start, session_end, etc.
Packages.config
• Packages.config file is managed by NuGet to track what packages and versions you have installed in the application.
Web.config
• Web.config file contains application-level configurations.

More Related Content

Similar to NET_Training.pptx

Web tech
Web techWeb tech
Web tech
SangeethaSasi1
 
Web techh
Web techhWeb techh
Web techh
SangeethaSasi1
 
Asp
AspAsp
Asp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answersAsp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answers
Mohan Raj
 
Asp.net tips
Asp.net tipsAsp.net tips
Asp.net tips
actacademy
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Peter Gfader
 
Walther Ajax4
Walther Ajax4Walther Ajax4
Walther Ajax4
rsnarayanan
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
Julie Iskander
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
Hitesh Santani
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer
home
 
Why use .net by naveen kumar veligeti
Why use .net by naveen kumar veligetiWhy use .net by naveen kumar veligeti
Why use .net by naveen kumar veligeti
Naveen Kumar Veligeti
 
Aspnet architecture
Aspnet architectureAspnet architecture
Aspnet architecture
phantrithuc
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
Vivek chan
 
As pnet
As pnetAs pnet
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
Iblesoft
 
16 asp.net session23
16 asp.net session2316 asp.net session23
16 asp.net session23
Vivek chan
 
Murach : How to work with session state and cookies
Murach : How to work with session state and cookiesMurach : How to work with session state and cookies
Murach : How to work with session state and cookies
MahmoudOHassouna
 
Asp.net By Durgesh Singh
Asp.net By Durgesh SinghAsp.net By Durgesh Singh
Asp.net By Durgesh Singh
imdurgesh
 
05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
Vivek chan
 
Asp.net
Asp.netAsp.net
Asp.net
vijilakshmi51
 

Similar to NET_Training.pptx (20)

Web tech
Web techWeb tech
Web tech
 
Web techh
Web techhWeb techh
Web techh
 
Asp
AspAsp
Asp
 
Asp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answersAsp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answers
 
Asp.net tips
Asp.net tipsAsp.net tips
Asp.net tips
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Walther Ajax4
Walther Ajax4Walther Ajax4
Walther Ajax4
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer
 
Why use .net by naveen kumar veligeti
Why use .net by naveen kumar veligetiWhy use .net by naveen kumar veligeti
Why use .net by naveen kumar veligeti
 
Aspnet architecture
Aspnet architectureAspnet architecture
Aspnet architecture
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
 
As pnet
As pnetAs pnet
As pnet
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
 
16 asp.net session23
16 asp.net session2316 asp.net session23
16 asp.net session23
 
Murach : How to work with session state and cookies
Murach : How to work with session state and cookiesMurach : How to work with session state and cookies
Murach : How to work with session state and cookies
 
Asp.net By Durgesh Singh
Asp.net By Durgesh SinghAsp.net By Durgesh Singh
Asp.net By Durgesh Singh
 
05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
 
Asp.net
Asp.netAsp.net
Asp.net
 

Recently uploaded

The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDFLifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Vivekanand Anglo Vedic Academy
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 

Recently uploaded (20)

The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDFLifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 

NET_Training.pptx

  • 1.
  • 3. 3 What is ASP.NET?  It is a web development platform provided by Microsoft.  It is used for creating web-based applications.  ASP.Net applications can also be written in a variety of .Net languages like C#, VB.Net, and J#.  ASP stands for Active Server Pages, and .NET is Network Enabled Technologies. What are the prerequisites to learn .NET?  Basic Computer Operating knowledge.  Commonsense
  • 4. 4 ASP.NET Architecture and its Components  A variety of languages exists for .net framework. They are VB.net and C#.  These can be used to develop web applications.  Has a set of standard class libraries.  The most used library for web applications is the Web library.  Web library has all the necessary components used to develop web-based applications  It is a platform on which the .Net programs are executed  Used for performing key activities like Exception handling and Garbage collection.
  • 5. 5 key characteristics of the ASP.Net framework  Code Behind Mode  Separates Code from the Design  State Management  To maintain the state of the application  Caching  To manage quick user access to the application
  • 6. 6 ASP.Net Lifecycle Start Object Creation HTTP Application Creation Dispose End  Request is made by a user to the Web server for the ASP.Net Application.  Application_start method is executed by the web server.  All the global variables are set to their default values.  Creation of the HttpContext, HttpRequest & HttpResponse by the web server.  HttpContext is the container for the HttpRequest and HttpResponse objects.  HttpRequest object contains information about the current request, including cookies and browser information.  HttpResponse object contains the response that is sent to the client.  This object is created by the web server.  It is used to process each subsequent request sent to the application.  This event is called before the application instance is destroyed.  Most commonly used to manually release any unmanaged resources.  The application is finally unloaded from memory.
  • 7. 7 ASP.Net Page Lifecycle  When an ASP.Net page is called, it goes through a particular lifecycle.  This is done before the response is sent to the user.  When the page is requested from the server, the server checks if it is requested for the first time.  If so, then it needs to compile the page, parse the response and send it across to the user.  If it is not the first time the page is requested, the cache is checked to see if the page output exists.  If so, that response is sent to the user.  At this stage, 2 objects [Request and Response] are created.  Request object is used to hold all the information which was sent when the page was requested.  Response object is used to hold the information which is sent back to the user.  At this stage, all the controls on a web page is initialized.  So, if there are any label, textbox or any other controls on the web form, they all will get initialized.  This is when the page is loaded with all the default values.  So, if a textbox is supposed to have a default value, that value is loaded during the page load time.  Validations are performed on the form elements.  This event is triggered if the same page is being loaded again.  This happens in response to an earlier event. Sometimes there can be a situation that a user clicks on a submit button on the page.  In this case, the same page is displayed again. In such a case, the Postback event handler is called.  This happens just before all the response information is sent to the user.  All the information on the form is saved, and the result is sent to the user as a complete web page.  Once the page output is sent to the user, the unloading process starts removing all unwanted objects from memory.
  • 9. 9 Adding ASP.Net Controls to Web Forms  ASP.Net has the ability to add controls to a form such as textboxes and labels.  Label Control  The label control is used to display a text or a message to the user on the form.  The label control is normally used along with other controls.  The label gives an indication to the user on what is expected to be done in the other control. <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>  Textbox  A text box is used for allowing a user to enter some text on the Web form application. <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>  List box  A Listbox is used to showcase a list of items on the Web form. <asp:ListBox ID="ListBox1" runat="server"></asp:ListBox>
  • 10. 10 Adding ASP.Net Controls to Web Forms  RadioButton  A Radio button is used to showcase a list of items out of which the user can choose one. <asp:RadioButton ID="RadioButton1" runat="server" />  Checkbox  A checkbox is used to provide a list of options in which the user can choose multiple choices. <asp:CheckBox ID="CheckBox1" runat="server" />  Button  A button is used to allow the user to click on a button which would then start the processing of the form. <asp:Button ID="Button1" runat="server" Text="Button" />
  • 11. 11 Event Handling in ASP.Net  When working with a web form, you can add events to controls.  An event is something that happens when an action is performed.  The most common action is the clicking of a button on a form.  This code can be used to perform certain actions when a button is pressed on the form.  This is generally the most common event in Web Forms.
  • 12. 12 ASP.NET Session Management  The HTTP protocol on which all web applications work is a stateless protocol.  It means that information is not retained from one request to another.  In ASP.Net, the data is passed on to next page using  ViewState.  Session Object View State  This is wherein ASP.Net automatically stores the contents of all the controls.  It also ensures this is passed onto the next page.  This is done via a property called the ViewState. Note: It is not ideal for a developer to change anything in the view state. This is because it should be handled by ASP.Net only.
  • 13. 13 Session Object  The Session object is available throughout the lifecycle of the application.  You can store any number of key-value pairs in the Session object.  So on any page, you can store a value in the Session object via the below line of code Session["Key"]=value Note: It is not ideal for a developer to change anything in the view state. This is because it should be handled by ASP.Net only.
  • 15. 15 Connecting to Database  Key Terminologies  Connection  To work with the data in a database, the first step is the connection.  It consists of the below-mentioned parameters.  Database name or Data Source – The first important parameter is the database name. Each connection can only work with one database at a time.  Credentials – The next important aspect is the 'username' and 'password'. This is used to establish a connection to the database.  Optional parameters - You can specify optional parameters on how .net should handle the connection to the database. For example, one can specify a parameter for how long the connection should stay active.  Selecting data from the database  Once the connection is established, data is fetched from the database.  ASP.Net has the ability to execute 'sql' select command against the database.  The 'sql' statement can be used to fetch data from a specific table in the database.  Inserting data into the database  ASP.Net is used to insert records into the database.  Values for each row that needs to be inserted in the database are specified in ASP.Net.
  • 16. 16 Connecting to Database  Key Terminologies  Updating data into the database  New values can be specified in ASP.Net for each row that needs to be updated into the database.  Deleting data from a database  The code is written to delete a particular row from the database.
  • 18. 18 Level Tracing, Debugging, Error Handling and Unit Testing What is Debugging  It is the process of adding breakpoints to an application.  These breakpoints are used to pause the execution of a running program.  This allows the developer to understand what is happening in a program at a particular point in time. Application Tracing  Application tracing allows one to see if any pages requested results in an error.  When tracing is enabled, an extra page called trace.axd is added to the application.  This page will show all the requests and their status. <trace enable="true" pageOutput="false" requestLimit="40" localOnly="false"/> Page Level Tracing  Page tracing shows all the general information about a web page when it is being processed.  This is useful in debugging if a page does not work for any reason.  Visual Studio will provide detailed information about various aspects of the page.  This information is displayed when the application run's in Visual Studio.
  • 19. 19 Level Tracing, Debugging, Error Handling and Unit Testing Page Level Tracing  Page tracing shows all the general information about a web page when it is being processed.  This is useful in debugging if a page does not work for any reason.  Visual Studio will provide detailed information about various aspects of the page.  This information is displayed when the application run's in Visual Studio. Error Handling: Displaying a Custom Error Page Steps for Custom Error Page:  Add the HTML page to display a custom error.  Update the web.config file with the customErrors tag  <customErrors mode="On" defaultRedirect="ErrorPage.html"> </customErrors>  Create the code with error .aspx.cs
  • 21. 21 ASP.NET MVC What is ASP.NET MVC  It is an open source web development framework from Microsoft that provides a Model View Controller architecture.  ASP.net MVC offers an alternative to ASP.net web forms for building web applications.  It is a part of the .Net platform for building, deploying and running web apps.  You can develop web apps and website with the help of HTML, CSS, jQuery, Javascript, etc.  MVC stands for Model, View, and Controller.  MVC separates an application into three components - Model, View, and Controller Model: Model represents the shape of the data. A class in C# is used to describe a model. Model objects store data retrieved from the database. Model represents the data.
  • 22. 22 ASP.NET MVC Model: View in MVC is a user interface. View display model data to the user and also enables them to modify them. View in ASP.NET MVC is HTML, CSS, and some special syntax (Razor syntax) that makes it easy to communicate with the model and the controller. View is the User Interface. Controller: The controller handles the user request. Typically, the user uses the view and raises an HTTP request, which will be handled by the controller. The controller processes the request and returns the appropriate view as a response. Controller is the request handler.
  • 25. 25 Create ASP.NET MVC Application
  • 26. 26 Create ASP.NET MVC Application
  • 28. 28 ASP.NET MVC Folder Structure App_Data • The App_Data folder can contain application data files like LocalDB, .mdf files, XML files, and other data related files. • IIS will never serve files from App_Data folder. App_Start • The App_Start folder can contain class files that will be executed when the application starts. • Typically, these would be config files like AuthConfig.cs, BundleConfig.cs, FilterConfig.cs, RouteConfig.cs etc.
  • 29. 29 ASP.NET MVC Folder Structure Content • The Content folder contains static files like CSS files, images, and icons files. • MVC 5 application includes bootstrap.css, bootstrap.min.css, and Site.css by default.
  • 30. 30 ASP.NET MVC Folder Structure Content • The Content folder contains static files like CSS files, images, and icons files. • MVC 5 application includes bootstrap.css, bootstrap.min.css, and Site.css by default.
  • 31. 31 ASP.NET MVC Folder Structure Controllers • The Controllers folder contains class files for the controllers. • A Controller handles users' request and returns a response. • MVC requires the name of all controller files to end with "Controller".
  • 32. 32 ASP.NET MVC Folder Structure fonts • The Fonts folder contains custom font files for your application.
  • 33. 33 ASP.NET MVC Folder Structure fonts • The Fonts folder contains custom font files for your application.
  • 34. 34 ASP.NET MVC Folder Structure Models • The Models folder contains model class files. • Typically, model class includes public properties, which will be used by the application to hold and manipulate application data.
  • 35. 35 ASP.NET MVC Folder Structure Scripts • The Scripts folder contains JavaScript or VBScript files for the application. • MVC 5 includes javascript files for bootstrap, jquery 1.10, and modernizer by default.
  • 36. 36 ASP.NET MVC Folder Structure Views • The Views folder contains HTML files for the application. • Typically view file is a .cshtml file where you write HTML and C# or VB.NET code. • The Views folder includes a separate folder for each controller. • The Shared folder under the View folder contains all the views shared among different controllers e.g., layout files.
  • 37. 37 ASP.NET MVC Folder Structure Global.asax • Global.asax file allows you to write code that runs in response to application-level events, such as Application_BeginRequest, application_start, application_error, session_start, session_end, etc. Packages.config • Packages.config file is managed by NuGet to track what packages and versions you have installed in the application. Web.config • Web.config file contains application-level configurations.