SlideShare a Scribd company logo
ASP.NET
Active Server Pages
PRATIK TAMBEKAR
(Sr. Software Developer at Ensivo Solutions Pvt. Ltd.)
What is ASP.Net?
• ASP.Net is a web development platform provided by
Microsoft. It is used for creating web-based
applications. ASP.Net was first released in the year
2002.
• The first version of ASP.Net deployed was 1.0. The most
recent version of ASP.Net is version 4.6. ASP.Net is
designed to work with the HTTP protocol. This is the
standard protocol used across all web applications.
• ASP.Net applications can also be written in a variety of
.Net languages. These include C#, VB.Net.
ASP.NET Architecture and its
Components
• ASP.Net is a framework which is used to develop
a Web-based application. The basic architecture
of the ASP.Net framework is as shown below.
ASP.NET Architecture Contd..
The architecture of the .Net framework is based on the
following key components
• Language – A variety of languages exists for .NET framework.
They are VB.net and C#. These can be used to develop web
applications.
• Library - The .NET Framework includes a set of standard class
libraries. The most common library used for web applications
in .net is the Web library. The web library has all the necessary
components used to develop .Net web-based applications.
• Common Language Runtime - The Common Language
Infrastructure or CLI is a platform. .Net programs are executed
on this platform. The CLR is used for performing key activities.
Activities include Exception handling and Garbage collection.
Below are some of the key
characteristics of the ASP.Net
framework
• Code Behind Mode
– This is the concept of separation of design and code
– web page called MyPage.aspx. There will be another
file called MyPage.aspx.cs which would denote the
code part of the page
• State Management
• Caching
• ASP.NET and ASP.NET AJAX
• ADO.NET
• Windows Forms
What is ASP.Net Lifecycle?
• When an ASP.Net application is launched,
there are series of steps which are carried
out.
What is 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.
ASP.NET - Environment Setup
Step 1) The first step involves the creation of a new project in
Visual Studio. After launching Visual Studio, you need to
choose the menu option New->Project.
Contd...
Step 2) The next step is to choose the project type as an ASP.Net
Web application. Here we also need to mention the name and
location of our project.
Contd...
Step 3) In the next screen, you have to choose the type of
ASP.net web application that needs to be created. In our case,
we are going to create a simple Web Form application.
Contd...
• If the above steps are followed, you will get
the below output in Visual Studio.
Output:-
Contd...
• Step 4) Now, it's time to add a Web Form file to
the project. This is the file which will contain all
the web-specific code for our project.
Contd...
• Step 5) In the next
screen we are going to
be prompted to provide
a name for the web
form.
• Give a name for the
Web Form. In our case,
we are giving it a name
of Demo.
• Click the Ok button.
Contd...
• Step 6) The next step is to add the code, which
will do the work of displaying "Hello World." This
can be done by just adding one line of code to
the Demo.aspx file.
Page Layout
<!-- directives -->
<% @Page Language="C#" %>
<!-- code section -->
<script runat="server">
private void convertoupper(object sender, EventArgs e)
{
string str = mytext.Value; changed_text.InnerHtml =
str.ToUpper();
}
</script>
Contd...
<!-- Layout -->
<html>
<head>
<title> Change to Upper Case </title>
</head>
<body>
<h3> Conversion to Upper Case </h3>
<form runat="server">
<input runat="server" id="mytext" type="text" />
<input runat="server" id="button1" type="submit"
value="Enter..." OnServerClick="convertoupper"/>
<hr />
<h3> Results: </h3>
<span runat="server" id="changed_text" />
</form>
</body>
</html>
ASP.NET - Event Handling
• An event is an action or occurrence such as a
mouse click, a key press, mouse movements,
or any system-generated notification.
Event Arguments
The general syntax of an event is:
private void EventName (object sender,
EventArgs e){}
Event Handling Using Controls
The ASP tag for a button control:
<asp:Button ID="btnCancel" runat="server"
Text="Cancel" />
<asp:Button ID="btnCancel" runat="server"
Text="Cancel" Onclick="btnCancel_Click" />
ASP.NET Controls:
• ASP.Net has the ability to add controls to a
form such as textboxes and labels.
Step 1) The first step is to open the Forms
Designer for the Demo web form. Once you
do this, you will be able to drag controls from
the toolbox to the Web form.
– To open the Designer web form,
– Right-click the Demo.aspx file in the Solution
Explorer and
– Choose the menu option View Designer.
Contd...
Contd...
• Once you perform the above step, you will be
able to see your Form Designer as shown
below.
Contd...
• 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.
Contd...
Step 2) Once the label has been added, follow
the following steps.
– Go to the properties window by right-clicking on
the label control
– Choose the Properties menu option
Contd...
Step 3) From the
properties
window,
change the
name of the
Text property
to Name
Contd...
• Similarly, also change
the ID property value
of the control to
lblName. By
specifying a
meaningful ID to
controls, it becomes
easier to access them
during the coding
phase. This is shown
below.
Contd...
• Once you make
the above
changes, you will
see the following
output
Output:-
sum of 2 asp:textbox values using c#
asp.net
First Number: <asp:TextBox runat="server"
id="TB1" /><br />
Second Number: <asp:TextBox runat="server"
id="TB2" /><br />
<asp:Button runat="server" id="CalculateBtn"
OnClick="CalculateBtn_Click" Text="Calcualte
Sum" />
Sum: <asp:TextBox runat="server" id="SumTB" />
Contd...
protected void CalculateBtn_Click (object
sender, EventArgs e)
{
int num1 = Int32.Parse(TB1.Text);
int num2 = Int32.Parse(TB2.Text);
int sum = num1+num2;
SumTB.Text = sum.ToString();
}
Example
simple example has a text box control where
the user can enter name, a button to send
the information to the server, and a label
control to display the URL of the client
computer.
Contd...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="server_side._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div> Enter your name: <br />
<asp:TextBox ID="TextBox1" runat="server">
</asp:TextBox> <asp:Button ID="Button1" runat="server"
OnClick="Button1_Click" Text="Submit" />
<br />
<asp:Label ID="Label1" runat="server"/>
</div>
</form>
</body>
</html>
Contd...
The code behind Button1_Click:
protected void Button1_Click(object sender,
EventArgs e)
{
if (!String.IsNullOrEmpty(TextBox1.Text))
{
Label1.Text = "Welcome, " +
Server.HtmlEncode(TextBox1.Text) + ". <br/> The url is
" + Server.UrlEncode(Request.Url.ToString())
}
}
OR
Response.Write(Label1.Text + "</br>");
THANK YOU!!!!
PRATIK TAMBEKAR
(Sr. Software Developer at Ensivo Solutions Pvt. Ltd.)
Ad

More Related Content

What's hot (20)

ASP.NET Session 4
ASP.NET Session 4ASP.NET Session 4
ASP.NET Session 4
Sisir Ghosh
 
2310 b 03
2310 b 032310 b 03
2310 b 03
Krazy Koder
 
html 5 new form attribute
html 5 new form attributehtml 5 new form attribute
html 5 new form attribute
Priyanka Rasal
 
Windows Phone Workshop: WCF services
Windows Phone Workshop: WCF services Windows Phone Workshop: WCF services
Windows Phone Workshop: WCF services
Zayen Chagra
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
WebStackAcademy
 
Forms with html5 (1)
Forms with html5 (1)Forms with html5 (1)
Forms with html5 (1)
Anada Kale
 
Wcf routing kt
Wcf routing ktWcf routing kt
Wcf routing kt
Krunal Trivedi
 
Anand june-2012
Anand june-2012Anand june-2012
Anand june-2012
Anand Doshi
 
ASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation Controls
Randy Connolly
 
Dev days Visual Studio 2012 Enhancements
Dev days Visual Studio 2012 EnhancementsDev days Visual Studio 2012 Enhancements
Dev days Visual Studio 2012 Enhancements
Abhishek Sur
 
Javascript
JavascriptJavascript
Javascript
Sun Technlogies
 
HTML Forms Tutorial
HTML Forms TutorialHTML Forms Tutorial
HTML Forms Tutorial
ProdigyView
 
Debugging Javascript
Debugging JavascriptDebugging Javascript
Debugging Javascript
SolTech, Inc.
 
Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...
Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...
Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...
Richard Rabins
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
vmmanikandan
 
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationAngular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and Authorization
WebStackAcademy
 
Java script
Java scriptJava script
Java script
ITz_1
 
Forms in html5
Forms in html5Forms in html5
Forms in html5
hrisi87
 
Less04 2 e_testermodule_3
Less04 2 e_testermodule_3Less04 2 e_testermodule_3
Less04 2 e_testermodule_3
Suresh Mishra
 
ASP.NET Session 4
ASP.NET Session 4ASP.NET Session 4
ASP.NET Session 4
Sisir Ghosh
 
html 5 new form attribute
html 5 new form attributehtml 5 new form attribute
html 5 new form attribute
Priyanka Rasal
 
Windows Phone Workshop: WCF services
Windows Phone Workshop: WCF services Windows Phone Workshop: WCF services
Windows Phone Workshop: WCF services
Zayen Chagra
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
WebStackAcademy
 
Forms with html5 (1)
Forms with html5 (1)Forms with html5 (1)
Forms with html5 (1)
Anada Kale
 
ASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation Controls
Randy Connolly
 
Dev days Visual Studio 2012 Enhancements
Dev days Visual Studio 2012 EnhancementsDev days Visual Studio 2012 Enhancements
Dev days Visual Studio 2012 Enhancements
Abhishek Sur
 
HTML Forms Tutorial
HTML Forms TutorialHTML Forms Tutorial
HTML Forms Tutorial
ProdigyView
 
Debugging Javascript
Debugging JavascriptDebugging Javascript
Debugging Javascript
SolTech, Inc.
 
Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...
Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...
Building a Blogging System -- Rapidly using Alpha Five v10 with Codeless AJAX...
Richard Rabins
 
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationAngular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and Authorization
WebStackAcademy
 
Java script
Java scriptJava script
Java script
ITz_1
 
Forms in html5
Forms in html5Forms in html5
Forms in html5
hrisi87
 
Less04 2 e_testermodule_3
Less04 2 e_testermodule_3Less04 2 e_testermodule_3
Less04 2 e_testermodule_3
Suresh Mishra
 

Similar to ASP DOT NET (20)

ASP.NET Basics
ASP.NET Basics ASP.NET Basics
ASP.NET Basics
baabtra.com - No. 1 supplier of quality freshers
 
As pnet
As pnetAs pnet
As pnet
Abhishek Kesharwani
 
.Net Framework Overview. Fundamentals of .Net Framework
.Net Framework Overview. Fundamentals of .Net Framework.Net Framework Overview. Fundamentals of .Net Framework
.Net Framework Overview. Fundamentals of .Net Framework
pavankumar47666
 
Introduction to asp
Introduction to aspIntroduction to asp
Introduction to asp
Madhuri Kavade
 
Migration from ASP to ASP.NET
Migration from ASP to ASP.NETMigration from ASP to ASP.NET
Migration from ASP to ASP.NET
Information Technology
 
Java script
Java scriptJava script
Java script
fahhadalghamdi
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
Md. Mahedee Hasan
 
Introduction to VB.Net.pptx
Introduction to VB.Net.pptxIntroduction to VB.Net.pptx
Introduction to VB.Net.pptx
SheinahdenMayTenerif
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
Raed Aldahdooh
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applications
Deepankar Pathak
 
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
Jignesh Aakoliya
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.ppt
IbrahimBurhan6
 
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.pptintroaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
AvijitChaudhuri3
 
Introduction to ASP.net. It provides basic introduction
Introduction to ASP.net. It provides basic introductionIntroduction to ASP.net. It provides basic introduction
Introduction to ASP.net. It provides basic introduction
ssuserbf6ebe
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.ppt
asmachehbi
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
Rishi Kothari
 
Aspintro
AspintroAspintro
Aspintro
ambar chakraborty
 
Introaspnet
IntroaspnetIntroaspnet
Introaspnet
Nagaraju Yajjuvarapu
 
INTRODUCTION TO ASP.NET COMPLETE MATERIALCOURSE
INTRODUCTION TO ASP.NET COMPLETE MATERIALCOURSEINTRODUCTION TO ASP.NET COMPLETE MATERIALCOURSE
INTRODUCTION TO ASP.NET COMPLETE MATERIALCOURSE
passtime0530
 
This is the introduction to Asp.Net Using C# Introduction Variables State Man...
This is the introduction to Asp.Net Using C# Introduction Variables State Man...This is the introduction to Asp.Net Using C# Introduction Variables State Man...
This is the introduction to Asp.Net Using C# Introduction Variables State Man...
sagar490070
 
.Net Framework Overview. Fundamentals of .Net Framework
.Net Framework Overview. Fundamentals of .Net Framework.Net Framework Overview. Fundamentals of .Net Framework
.Net Framework Overview. Fundamentals of .Net Framework
pavankumar47666
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
Raed Aldahdooh
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applications
Deepankar Pathak
 
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
Jignesh Aakoliya
 
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.pptintroaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
AvijitChaudhuri3
 
Introduction to ASP.net. It provides basic introduction
Introduction to ASP.net. It provides basic introductionIntroduction to ASP.net. It provides basic introduction
Introduction to ASP.net. It provides basic introduction
ssuserbf6ebe
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.ppt
asmachehbi
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
Rishi Kothari
 
INTRODUCTION TO ASP.NET COMPLETE MATERIALCOURSE
INTRODUCTION TO ASP.NET COMPLETE MATERIALCOURSEINTRODUCTION TO ASP.NET COMPLETE MATERIALCOURSE
INTRODUCTION TO ASP.NET COMPLETE MATERIALCOURSE
passtime0530
 
This is the introduction to Asp.Net Using C# Introduction Variables State Man...
This is the introduction to Asp.Net Using C# Introduction Variables State Man...This is the introduction to Asp.Net Using C# Introduction Variables State Man...
This is the introduction to Asp.Net Using C# Introduction Variables State Man...
sagar490070
 
Ad

More from Pratik Tambekar (17)

Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Data Mining Concepts and Techniques
Data Mining Concepts and TechniquesData Mining Concepts and Techniques
Data Mining Concepts and Techniques
Pratik Tambekar
 
What Is DATA MINING(INTRODUCTION)
What Is DATA MINING(INTRODUCTION)What Is DATA MINING(INTRODUCTION)
What Is DATA MINING(INTRODUCTION)
Pratik Tambekar
 
Distributed Transaction
Distributed TransactionDistributed Transaction
Distributed Transaction
Pratik Tambekar
 
World Wide Web(WWW)
World Wide Web(WWW)World Wide Web(WWW)
World Wide Web(WWW)
Pratik Tambekar
 
How To Add System Call In Ubuntu OS
How To Add System Call In Ubuntu OSHow To Add System Call In Ubuntu OS
How To Add System Call In Ubuntu OS
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Data Mining Concepts and Techniques
Data Mining Concepts and TechniquesData Mining Concepts and Techniques
Data Mining Concepts and Techniques
Pratik Tambekar
 
What Is DATA MINING(INTRODUCTION)
What Is DATA MINING(INTRODUCTION)What Is DATA MINING(INTRODUCTION)
What Is DATA MINING(INTRODUCTION)
Pratik Tambekar
 
How To Add System Call In Ubuntu OS
How To Add System Call In Ubuntu OSHow To Add System Call In Ubuntu OS
How To Add System Call In Ubuntu OS
Pratik Tambekar
 
Ad

Recently uploaded (20)

Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Journal of Soft Computing in Civil Engineering
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 

ASP DOT NET

  • 1. ASP.NET Active Server Pages PRATIK TAMBEKAR (Sr. Software Developer at Ensivo Solutions Pvt. Ltd.)
  • 2. What is ASP.Net? • ASP.Net is a web development platform provided by Microsoft. It is used for creating web-based applications. ASP.Net was first released in the year 2002. • The first version of ASP.Net deployed was 1.0. The most recent version of ASP.Net is version 4.6. ASP.Net is designed to work with the HTTP protocol. This is the standard protocol used across all web applications. • ASP.Net applications can also be written in a variety of .Net languages. These include C#, VB.Net.
  • 3. ASP.NET Architecture and its Components • ASP.Net is a framework which is used to develop a Web-based application. The basic architecture of the ASP.Net framework is as shown below.
  • 4. ASP.NET Architecture Contd.. The architecture of the .Net framework is based on the following key components • Language – A variety of languages exists for .NET framework. They are VB.net and C#. These can be used to develop web applications. • Library - The .NET Framework includes a set of standard class libraries. The most common library used for web applications in .net is the Web library. The web library has all the necessary components used to develop .Net web-based applications. • Common Language Runtime - The Common Language Infrastructure or CLI is a platform. .Net programs are executed on this platform. The CLR is used for performing key activities. Activities include Exception handling and Garbage collection.
  • 5. Below are some of the key characteristics of the ASP.Net framework • Code Behind Mode – This is the concept of separation of design and code – web page called MyPage.aspx. There will be another file called MyPage.aspx.cs which would denote the code part of the page • State Management • Caching • ASP.NET and ASP.NET AJAX • ADO.NET • Windows Forms
  • 6. What is ASP.Net Lifecycle? • When an ASP.Net application is launched, there are series of steps which are carried out.
  • 7. What is 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.
  • 8. ASP.NET - Environment Setup Step 1) The first step involves the creation of a new project in Visual Studio. After launching Visual Studio, you need to choose the menu option New->Project.
  • 9. Contd... Step 2) The next step is to choose the project type as an ASP.Net Web application. Here we also need to mention the name and location of our project.
  • 10. Contd... Step 3) In the next screen, you have to choose the type of ASP.net web application that needs to be created. In our case, we are going to create a simple Web Form application.
  • 11. Contd... • If the above steps are followed, you will get the below output in Visual Studio. Output:-
  • 12. Contd... • Step 4) Now, it's time to add a Web Form file to the project. This is the file which will contain all the web-specific code for our project.
  • 13. Contd... • Step 5) In the next screen we are going to be prompted to provide a name for the web form. • Give a name for the Web Form. In our case, we are giving it a name of Demo. • Click the Ok button.
  • 14. Contd... • Step 6) The next step is to add the code, which will do the work of displaying "Hello World." This can be done by just adding one line of code to the Demo.aspx file.
  • 15. Page Layout <!-- directives --> <% @Page Language="C#" %> <!-- code section --> <script runat="server"> private void convertoupper(object sender, EventArgs e) { string str = mytext.Value; changed_text.InnerHtml = str.ToUpper(); } </script>
  • 16. Contd... <!-- Layout --> <html> <head> <title> Change to Upper Case </title> </head> <body> <h3> Conversion to Upper Case </h3> <form runat="server"> <input runat="server" id="mytext" type="text" /> <input runat="server" id="button1" type="submit" value="Enter..." OnServerClick="convertoupper"/> <hr /> <h3> Results: </h3> <span runat="server" id="changed_text" /> </form> </body> </html>
  • 17. ASP.NET - Event Handling • An event is an action or occurrence such as a mouse click, a key press, mouse movements, or any system-generated notification. Event Arguments The general syntax of an event is: private void EventName (object sender, EventArgs e){}
  • 18. Event Handling Using Controls The ASP tag for a button control: <asp:Button ID="btnCancel" runat="server" Text="Cancel" /> <asp:Button ID="btnCancel" runat="server" Text="Cancel" Onclick="btnCancel_Click" />
  • 19. ASP.NET Controls: • ASP.Net has the ability to add controls to a form such as textboxes and labels. Step 1) The first step is to open the Forms Designer for the Demo web form. Once you do this, you will be able to drag controls from the toolbox to the Web form. – To open the Designer web form, – Right-click the Demo.aspx file in the Solution Explorer and – Choose the menu option View Designer.
  • 21. Contd... • Once you perform the above step, you will be able to see your Form Designer as shown below.
  • 22. Contd... • 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.
  • 23. Contd... Step 2) Once the label has been added, follow the following steps. – Go to the properties window by right-clicking on the label control – Choose the Properties menu option
  • 24. Contd... Step 3) From the properties window, change the name of the Text property to Name
  • 25. Contd... • Similarly, also change the ID property value of the control to lblName. By specifying a meaningful ID to controls, it becomes easier to access them during the coding phase. This is shown below.
  • 26. Contd... • Once you make the above changes, you will see the following output Output:-
  • 27. sum of 2 asp:textbox values using c# asp.net First Number: <asp:TextBox runat="server" id="TB1" /><br /> Second Number: <asp:TextBox runat="server" id="TB2" /><br /> <asp:Button runat="server" id="CalculateBtn" OnClick="CalculateBtn_Click" Text="Calcualte Sum" /> Sum: <asp:TextBox runat="server" id="SumTB" />
  • 28. Contd... protected void CalculateBtn_Click (object sender, EventArgs e) { int num1 = Int32.Parse(TB1.Text); int num2 = Int32.Parse(TB2.Text); int sum = num1+num2; SumTB.Text = sum.ToString(); }
  • 29. Example simple example has a text box control where the user can enter name, a button to send the information to the server, and a label control to display the URL of the client computer.
  • 30. Contd... <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="server_side._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> Enter your name: <br /> <asp:TextBox ID="TextBox1" runat="server"> </asp:TextBox> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Submit" /> <br /> <asp:Label ID="Label1" runat="server"/> </div> </form> </body> </html>
  • 31. Contd... The code behind Button1_Click: protected void Button1_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(TextBox1.Text)) { Label1.Text = "Welcome, " + Server.HtmlEncode(TextBox1.Text) + ". <br/> The url is " + Server.UrlEncode(Request.Url.ToString()) } } OR Response.Write(Label1.Text + "</br>");
  • 32. THANK YOU!!!! PRATIK TAMBEKAR (Sr. Software Developer at Ensivo Solutions Pvt. Ltd.)