You are on page 1of 5

web server is a system that delivers content or services to end users over the internet.

A web server consists of a physical server, server operating


system (OS) and software used to facilitate HTTP communication. A web server is also known as an internet server. The .NET Framework allows
developers to create their own server controls that operate exactly like the prepackaged controls that come with Visual Studio .NET. ASP.NET server
controls are the primary controls used in ASP.NET. types of server controls - HTML Server Controls - Traditional HTML tags, Web Server Controls -
New ASP. NET tags , Validation Server Controls - For input validation .
an application server exposes business logic to client applications through various protocols, possibly including HTTP. While a Web server mainly
deals with sending HTML for display in a Web browser, an application server provides access to business logic for use by client application programs.
The application program can use this logic just as it would call a method on an object
PWS Web Server- can be used with a full-time Internet connection to serve Web pages for a Web site with limited traffic. It can also be used for testing a
Web site offline or from a "staging" site before putting it on a main Web site that is exposed to larger traffic.PWS can be used together with Microsoft's
FrontPage, a Web site design product, to upload Web pages from a remote location or to the local hard drive; to check for dead links; to create
directories; and to set permissions.
IIS web server - Internet Information Server (IIS) is one of the most popular web servers from Microsoft that is used to host and provide Internet-based
services to ASP.NET and ASP Web applications. A web server is responsible for providing a response to requests that come from users. When a
request comes from client to server IIS takes that request from users and process it and send response back to users.Internet Information Server (IIS)
has it's own ASP.NET Process Engine to handle the ASP.NET request. The way you configure an ASP.NET application depends on what version of IIS
the application is running on. All websites need to be hosted on a server from where people access them. You might have heard about Java folks
hosting their websites in Apache Tomcat, for websites created using ASP.NET.

Asp & 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. ASP.Net is a framework which is used to develop a Web-based application.
Diff – Asp is interpreted whereas, ASP.NET is compiled. This implies that since ASP uses VBScript; therefore, when an ASP page is executed, it is
interpreted. On the other hand, ASP.NET uses .NET languages, such as C# and VB.NET, which are compiled to Microsoft Intermediate Language
(MSIL). 1. ASP is interpreted, ASP.NET is compiled. 2. Classic ASP uses a technology called ADO to connect and work with databases. ASP.NET uses
the ADO.NET technology 3. ASP has Mixed HTML and coding logic where in asp.net html and coding part are separated by code behind files. 4.
ASP.NET purely object oriented whereas ASP is partially object oriented. 5. For ASP No in-built support for XML whereas in ASP.NET full XML Support
for easy data exchange.
Features – 1. Cross-platform & container support - With the introduction of .NET Core, you can now create ASP.NET applications and deploy them to
Windows, Linux, and macOS. Microsoft and the community have put a huge effort into making Linux a first-class citizen for running ASP.NET. 2.
Asynchronous via async/await. ASP.NET has excellent support for utilizing asynchronous programming patterns. Async is now implemented in all
common .NET Framework classes and most third-party libraries. 3. Built-in Windows authentication and per-application configuration keep your
applications secured. 4. ASP.NET reduces the line of code needed to develop large applications. 5. The ASP code and HTML smoothly mix with each
other to generate dynamic web pages. 6. It is an ideal server-side scripting technology that is why code runs on the windows server before displaying
on the web browser. 7. Dot NET framework is language independent, so choose any programming language that best suited to develop your application.
8. ASP.NET is easy to deploy because of built-in configuration information.

C# is object oriented programming language. It provides a lot of features that are given below. - 1) Simple
C# is a simple language in the sense that it provides structured approach (to break the problem into parts), rich set of library functions, data types etc.2)
Modern Programming Language - c# programming is based upon the current trend and it is very powerful and simple for building scalable, interoperable
and robust applications. 3) Object Oriented - C# is object oriented programming language. OOPs makes development and maintenance easier where as
in Procedure-oriented programming language it is not easy to manage if code grows as project size grow. 4) Type Safe - C# type safe code can only
access the memory location that it has permission to execute. Therefore it improves a security of the program. 5) Interoperability - Interoperability
process enables the C# programs to do almost anything that a native C++ application can do. 6) Scalable and Updateable - C# is automatic scalable
and updateable programming language. For updating our application we delete the old files and update them with new ones.

Web form or HTML form on a web page allows a user to enter data that is sent to a server for processing. Forms can resemble paper or database forms
because web users fill out the forms using checkboxes, radio buttons, or text fields. Web Forms are pages that your users request using their browser.
These pages can be written using a combination of HTML, client-script, server controls, and server code. Using Visual Studio, you can create ASP.NET
Web Forms. The Visual Studio Integrated Development Environment (IDE) lets you drag and drop server controls to lay out your Web Forms page.
Controls - are small building blocks of the graphical user interface, which include text boxes, buttons, check boxes, list boxes, labels, and numerous
other tools. Using these tools, the users can enter data, make selections and indicate their preferences. Controls are also used for structural jobs, like
validation, data access, security, creating master pages, and data manipulation. ASP.Net server controls inherit all properties, events, and methods of
the WebControl and System.Web.UI.Control class. ASP.NET uses five types of web controls, which are: HTML controls, HTML Server controls,
ASP.NET Server controls, ASP.NET Ajax Server controls , User controls and custom controls.
These controls can be grouped into the following categories: - Validation controls ,Data source controls - These controls provides data binding to
different data sources. Data view controls, Personalization controls, Login and security controls , Master pages , Navigation controls, Rich controls
Client side HTML control : HTML controls are the native elements of browser. These are client side controls which is accessible only in the HTML page
and not executed in server side. In this senerio user requests the page, receive the page from the server, then display the HTML and process the
Javascript.The client side validation can be done using the Javascript or vb script. Client side validation is processed the client side before submitting the
form. The advantage of using the client side validation is it reduces the network trafiic since the validation is processed in the client machine itself.
so Client side HTML control will improve the performance of the web page.
Web Server Controls or ASP.NET controls Web Server Controls are group of controls derived directly from the System.Web.UI.WebControls base
class. They are executed on the server side and output HTML sent back to the client browser. If you use a textbox web control in webform, what
happens when the webform runs is the textbox server control is converted to html control(just like html client side control). This is extra headache when
we can have simple html controls in hand.So it is better to not use these web controls where performace is an impotant parameter. Events like load ,
reder , unload are associated with web controls which are not case for html ones.

HTML Forms are required, when you want to collect some data from the site visitor. For example, during user registration you would like to collect
information such as name, email address, credit card, etc. A form will take input from the site visitor and then will post it to a back-end application such
as CGI, ASP Script or PHP script etc. The back-end application will perform required processing on the passed data based on defined business logic
inside the application.There are various form elements available like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc.

Dot Net framework is a software development platform developed by Microsoft. The framework was meant to create applications, which would run on
the Windows Platform. The .Net framework can be used to create both - Form-based and Web-based applications. Web services can also be developed
using the .Net framework. The framework also supports various programming languages such as Visual Basic and C#. So developers can choose and
select the language to develop the required application. framework is based on the following key components; 1. Common Language Runtime - The
"Common Language Infrastructure" or CLI is a platform on which the .Net programs are executed. The CLI has the following key features: - Exception
Handling - Exceptions are errors which occur when the application is executed. Garbage Collection - Garbage collection is the process of removing
unwanted resources when they are no longer required. 2. Class Library - The .NET Framework includes a set of standard class libraries. A class library
is a collection of methods and functions that can be used for the core purpose. For example, there is a class library with methods to handle all file-level
operations. So there is a method which can be used to read the text from a file. Similarly, there is a method to write text to a file. 3. Languages - The
types of applications that can be built in the .Net framework is classified broadly into the following categories - WinForms , ASP.Net , ADO.Net .
Runtime Hosts - Describes the runtime hosts supported by the .NET Framework, including ASP.NET, Internet Explorer, and shell executables.
Common Type System - Identifies the types supported by the common language runtime.

Steps To Create And Run Web App - 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. Step 2) The next step is to choose the project type as an ASP.Net Web application. Step 3) In the next
screen, you have to choose the type of ASP.net web application that needs to be created. 4) First, choose the project type as 'Empty'. This will ensure
that we start with a basic application which is simple to understand. 5) We choose the option "web Forms". This adds the basic folders. These are
required for a basic Web Forms Application. 6) Finally, we click the 'OK' button to allow Visual Studio to create our application. 7) Step 5) In the next
screen we are going to be prompted to provide a name for the web form.Click Ok . 8) Automatically Visual Studio will create the Demo Web Form and
will open it in Visual Studio. 9) The next step is to add the code .

Validation is important part of any web application. User's input must always be validated before sending across different layers of the application.
ASP.NET validation controls validate the user input data to ensure that useless, unauthenticated, or contradictory data don't get stored.
Server Side Validation - In the Server Side Validation, the input submitted by the user is being sent to the server and validated using one of server side
scripting languages such as ASP.Net, PHP etc. After the validation process on the Server Side, the feedback is sent back to the client by a new
dynamically generated web page. It is better to validate user input on Server Side because you can protect against the malicious users, who can easily
bypass your Client Side scripting language and submit dangerous input to the server.
Client Side Validation you can provide a better user experience by responding quickly at the browser level. When you perform a Client Side Validation,
all the user inputs validated in the user's browser itself. Client Side validation does not require a round trip to the server, so the network traffic which will
help your server perform better.
ASP.NET provides the following validation controls: RequiredField, range , Compare, RegularExpression, Custom, ValidationSummary . Validation is
of two types: Client Side, Serve Side, Client side validation is good but we have to be dependent on browser and scripting language support. Client side
validation is considered convenient for users as they get instant feedback. server validation. It work on both end; first it will work on client validation
and than on server validation. At any cost server validation will work always whether client validation is executed or not. So you have a safety of
validation check.
RequiredFieldValidator control ensures that the required field is not empty. It is generally tied to a text box to force input into the text box. The syntax of
the control is as given: <asp:RequiredFieldValidator ID="rfvcandidate" runat="server" ControlToValidate ="ddlcandidate" ErrorMessage="Please
choose a candidate" InitialValue="Please choose a candidate"> </asp:RequiredFieldValidator>
RangeValidator control verifies that the input value falls within a predetermined range. <asp:RangeValidator ID="rvclass" runat="server"
ControlToValidate="txtclass" ErrorMessage="Enter your class (6 - 12)" MaximumValue="12" MinimumValue="6" Type="Integer">
</asp:RangeValidator>
CompareValidator control compares a value in one control with a fixed value or a value in another control. <asp: CompareValidator
ID="CompareValidator1" runat="server" ErrorMessage = "CompareValidator" > </asp: CompareValidator >
RegularExpressionValidator allows validating the input text by matching against a pattern of a regular expression. The regular expression is set in the
ValidationExpression property. <asp:RegularExpressionValidator ID= "string" runat = "server" ErrorMessage = "string" ValidationExpression="string"
ValidationGroup = "string"> </asp: RegularExpression Validator>
CustomValidator control allows writing application specific custom validation routines for both the client side and the server side validation. <asp:
CustomValidator ID = "CustomValidator1" runat = "server" ClientValidation Function =.cvf_func. ErrorMessage = "CustomValidator"> </asp:
CustomValidator>
ValidationSummary control enables you to display a list of all the validation errors in a page in one location. This control is particularly useful when
working with large forms. If a user enters the wrong value for a form field located toward the end of the page, then the user might never see the error
message. If you use the ValidationSummary control, however, you can always display a list of errors at the top of the form. The message assigned to the
ErrorMessage property, on the other hand, should identify the form field that has the error (for example, "First name is required!"). [ Prop – Display
mode , enable client script , forecolor , header text , show summery]

State management means to preserve state of a control, web page, object/data, and user in the application explicitly because all ASP.NET web
applications are stateless, i.e., by default, for each page posted to the server, the state of controls is lost. Nowadays all web apps demand a high level of
state management from control to application level. In a single line, State management maintains and stores the information of any user till the end of
the user session. Types –
A. Client-side State Management: View State , Hidden Field, Cookies, Control State. B. Server-side State Management:
Session, Application Object , Caching.
View State is a technique to maintain the state of controls during page post-back, meaning it stores the page value at the time of post-back (sending
and receiving information from the server) of your page and the view state data can be used when the page is posted back to the server and a new
instance of the page is created. ViewState["VarName"]= store any thing . View State advantages: Very easy to implement. Stored on the client browser
in a hidden field as a form of Base64 Encoding String not encrypted and can be decoded easily. Good with HTTP data transfer View State disadvt - The
performance overhead for the page is larger data stored in the view state. Stored as encoded and not very safe to use with sensitive information.
Session State - Session State is another state management technique to store state, meaning it helps in storing and using values from previous
requests. Whenever the user requests a web form from a web application it will get treated as a new request. an ASP.NET session will be used to store
the previous requests for a specified time period. By default, an ASP.NET session state is enabled for all ASP.NET applications. Session state data is
shared across all the web pages, in other words when navigating from one page session the data would available.
Application state is a data repository available to all classes in an ASP.NET application. Application state is stored in memory on the server and is
faster than storing and retrieving information in a database. Unlike session state, which is specific to a single user session, application state applies to all
users and sessions.
Advantages - Application variable data is multi-user global data stored in memory. Easy to access. Fast retrieval. Disadvt - Application variable data is
not able to survive the IIS restart and worker process recycling. Not suited for web farm and web garden like deployment situation.

AdRotator control randomly selects banner graphics from a list, which is specified in an external XML schedule file. This external XML schedule file is
called the advertisement file. The AdRotator control allows you to specify the advertisement file and the type of window that the link should follow in the
AdvertisementFile and the Target property respectively. Property - <Advertisement File>: It clubs all ads. <Ad>: Groups individual ads. <ImageUrl>:
image URL that will be displayed. <NavigateUrl>: Provide navigation URL for displayed image, if you will click that image, you will redirect that URL.
<Alternate Text>: This text will be available if image is not there. <Height>: To set the height of the ad. <Width>: To set the width of the ad.
<Impressions>: How often advertisement will appear. The ASP AdRotator component creates an AdRotator object that displays a different image each
time a user enters or refreshes a page. A text file includes information about the images.
Calander Control - Birthdays, anniversaries, appointments, holidays, bill payments, and project deadlines. All these have one thing in common. Guess?
It's a date. It is difficult to remember dates so for that calendar comes to your rescue. ASP .NET provides a Calendar control that is used to display a
calendar on the Web page. By default, this control displays the name of the current month, day headings for the days of the weeks, days of the month
and arrow characters for navigation to the previous or next month. [<asp:Calendar ID="Calendar1" runat="server" </asp:Calendar> ] Prop – [Day - Allow
selection of a single. date.- DayWeek Allows the selection of a single date or a complete week. dayWeekMonth - Allow selection of single date,
complete week or complete month. None - Doesn't allow you to select any date.

ADO.NET consist of a set of Objects that expose data access services to the .NET environment. It is a data access technology from Microsoft .Net
Framework , which provides communication between relational and non relational systems through a common set of components . System.Data
namespace is the core of ADO.NET and it contains classes used by all data providers. ADO.NET is designed to be easy to use, and Visual Studio
provides several wizards and other features that you can use to generate ADO.NET data access code. Data Providers and DataSet - The two
key components of ADO.NET are Data Providers and DataSet . The Data Provider classes are meant to work with different kinds of data sources. They
are used to perform all data-management operations on specific databases. Data Providers - The .Net Framework includes mainly three Data
Providers for ADO.NET. They are the Microsoft SQL Server Data Provider , OLEDB Data Provider and ODBC Data Provider. Connection Object
provides physical connection to the Data Source. Connection object needs the necessary information to recognize the data source and to log on to it
properly, this information is provided through a connection string. Command Object uses to perform SQL statement or stored procedure to be
executed at the Data Source. The command object provides a number of Execute methods that can be used to perform the SQL queries in a variety of
fashions. DataReader Object is a stream-based , forward-only, read-only retrieval of query results from the Data Source, which do not update the
data. DataAdapter Object populate a Dataset Object with results from a Data Source . It is a special class whose purpose is to bridge the gap
between the disconnected Dataset objects. [SqlDataAdapter adapter = new SqlDataAdapter (sql,connection ); adapter.Fill(ds);] DataSet provides a
disconnected representation of result sets from the Data Source . DataSet contains rows, columns,primary keys, constraints, and relations with other
DataTable objects. A DataSet is a container for one or more DataTable objects that contain the data you retrieve from the database. We can set up Data
Relations between these tables within the DataSet. The DataAdapter Object allows us to populate DataTables in a DataSet. We can use Fill method of
the DataAdapter for populating data in a Dataset.
Advt of ADO – Interoperability - The ability to communicate across heterogeneous environments. Scalability - The ability to serve a growing number of
clients without degrading system performance. Productivity - The ability to quickly develop robust data access applications using ADO.NET’s rich and
extensible component object model. Performance- An improvement over previous ADO versions due to the disconnected data model.

Database Connectivity - In every language, the most important part is database connectivity. This tip will cover all the aspects of database connectivity
in the form of Create Operation. This tip is useful for beginners and will help them understand the different steps in database connectivity. It will take 5
easy steps for connectivity. 1) Add a new project and give a name to it . 2) Add a new Web Form with Master Page and give a name (In my case, the
name is UserRegistration.aspx) and select Master Page. 3) The next step is to create a Registration Form as below and add the below code inside
Content Place holder whose Id is Content3 . 4) Run the application after setting this page as a Start Page (Right click on UserRegistration.aspx and click
on Set as Start page). Once run, we will get a page. 5) The next step is to generate a Button Click Event. For this, just right click on the Button and go to
Properties and double click on click event. 6) Run the application and fill the form and click on submit.

DataGrid - .NET Framework provides DataGrid control to display data on the web page. It was introduced in .NET 1.0 and now has been deprecated.
DataGrid is used to display data in scrollable grid. It requires data source to populate data in the grid. It is a server side control and can be dragged from
the toolbox to the web form. Data Source for the DataGrid can be either a DataTable or a database. Let's see an example, how can we create a
DataGrid in our application. [using System; using System.Data; namespace DataGridExample { public partial class DataGridExample2 :
ystem.Web.UI.Page { Load(object sender, EventArgs e) { DataTable table = new DataTable(); table. Columns. Add ("ID"); table. Columns. Add
("Name"); table. Columns. Add("Email"); table. Rows. Add("101", "Deepak Kumar", "Deepak @example.com"); table.Rows.Add("102", "John",
"john@example.com’’); DataGrid1.DataSource = table; DataGrid1. DataBind(); }}} ] We finish off by setting the grid back out of “edit mode”, by setting
the EditItemIndex property of the DataGrid control back to -1, and rebinding the control to display the result.

Data Bind - ASP.NET allows powerful feature of data binding, you can bind any server control to simple properties, collections, expressions and/or
methods. When you use data binding, you have more flexibility when you use data from a database or other means. Every ASP.NET web form control
inherits the DataBind method from its parent Control class, which gives it an inherent capability to bind data to at least one of its properties. This is
known as simple data binding or inline data binding. Simple data binding involves the read-only selection lists. These controls can bind to an array
list or fields from a database. Selection lists takes two values from the database or the data source; one value is displayed by the list and the other is
considered as the value corresponding to the display. Example – While Creating a web site with a bulleted list and a SqlDataSource control on it. We
have to Configure the data source control to retrieve two values from your database. Choosing a data source for the bulleted list control involves:-
Selecting the data source control, Selecting a field to display, Selecting a field for the value. When the application is executed, check that the entire title
column is bound to the bulleted list and displayed. Complex data binding occurs when you bind a list control or an iterative control to one or
more columns of data. List controls comprise DropDownList, CheckBoxList, RadioButtonList, and ListBox. Iterative controls are Repeater, DataList, and
DataGrid. List controls have a more complex and versatile user interface than labels and text boxes. Because a list control handles (or at least has in
memory) more items simultaneously than a label or a text box, you should associate the list control explicitly with a collection of data [public String
GetBound Data (String fieldName) { DataSet ds = (DataSet) Session["MyData"]; DataTable dt = ds.Tables["EmpTable"]; int nRowPos = (int)
Session["CurrentRecord"]; String buf = dt.Rows [nRowPos] [fieldName].ToString();return buf; }

Object Modelling - The most basic object in ASP.NET is the page. You can access properties of the page object directly without any qualifying object.
In the previous chapters, we have used some of the properties and methods of page object like Layout, RenderPage and RenderBody. WebPageBase
Class is the base class for classes that represent an ASP.NET Razor page. In this example, we will set the title of the page using the Page.Title
property. Here is the implementation of MyLayoutPage.cshtml file in which we have set the page title. [<!DOCTYPE html> <html lang = "en"> <head>
<title> @Page.Title </title> <link href = "@Href("/Styles/Site.css")" rel = "stylesheet" type = "text/css" /> </head> <body> @RenderPage
("/Shared/_Header.cshtml") <div id = "main">@RenderBody()</div> @RenderPage ("/Shared /_Footer.cshtml") </body> </html> ]

Connected & Dis Database - In C#, we work in two different ways with database connectivity. As you know when we create software or website or any
other application which is connected to the database we need to make connection to the database to get data. Here you can get data in two different
ways. Either it can be connected architecture where you go and connect to the database and get data or disconnected architecture where you connect
to the database first time and get all data in an object and use it if required. You can perform any action like insert, update, and search on this. In
Connection Oriented Data Access Architecture the application makes a connection to the Data Source and then interact with it through SQL requests
using the same connection. The DataSet is the central component in the ADO.NET Disconnected Data Access Architecture. A DataSet is an in-
memory data store that can hold multiple tables at the same time.
XML is a general purpose tag based language and very easy to transfer and store data across applications. XML stands for Extensible Markup
Language. It is a text-based markup language derived from Standard Generalized Markup Language (SGML). Uses - XML can work behind the scene
to simplify the creation of HTML documents for large web sites. used to exchange the information between organizations and systems. used for
offloading and reloading of databases. used to store and arrange the data, which can customize your data handling needs. uses of XML in ASP.NET-
Configuration such as .config files. Settings (for example, .settings files) , When you communicate with external web services, XML is a popular choice.
Creating XML File - There are two common ways to create XML using C#. First, using System.Xml namespace classes and the second, using LINQ to
XML. Once we create an XML file in one platform it can be used in other platforms also. In order to creating a new XML file in C#, we are using
XmlTextWriter Class . The class takes FileName and Encoding as argument. [ <?xml version="1.0" encoding="utf-8" ?> <!-- Books.xml stores
information about Mahesh Chand and related books --> <books> <book ISBN="9831123212" yearpublished="2002"> <title>A Programmer's Guide to
ADO.NET using C#</title> <author> <first-name>Mahesh</first-name> <last-name>Chand</last-name> </author> <publisher>Apress</publisher>
<price>44.99</price> </book> </books> ]
Read Dataset XML – Here we are going to read an XML file using a DataSet. Here Dataset is using an XmlReader for read the content of the file.
Locate the XML file using XmlReader and pass the XmlReader as argument of Dataset. [using System; using System.Data; using
System.Windows.Forms; using System.Xml; namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() {
InitializeComponent(); } private void button1_Click(object sender, ventArgs e) { XmlReader xmlFile ; xmlFile = XmlReader.Create("Product.xml", new
XmlReaderSettings()); DataSet ds = new dataSet(); ds.ReadXml(xmlFile); int i = 0; for (i = 0; i <= ds.Tables[0].Rows.Count - 1; i++) { MessageBox
.Show (ds.Tables[0]. Rows[i]. ItemArray[2]. ToString()); }}}}

Insert Data XML - Here we are going to insert the values of an XML file to a Database Table using SQL Insert Command . Here the Dataset using an
XmlReader for read the content of the XML file - Product.XML . After getting the data from XML file to the Dataset , we can loop through the dataset
values and use insert command to add the values to the Product table in the Databse.
Web Service is a software program that uses XML to exchange information with other software via common internet protocols. In a simple sense, Web
Services are a way for interacting with objects over the Internet. Web services provide a common platform that allows multiple applications built on
various programming languages to have the ability to communicate with each other. A web service is - Language Independent. Protocol Independent.
Platform Independent.
It assumes a stateless service architecture. Scalable . There are mainly two types of web services -SOAP web services , RESTful web services.
SOAP is known as a transport-independent messaging protocol. SOAP is based on transferring XML data as SOAP Messages. Each message has
something which is known as an XML document. Only the structure of the XML document follows a specific pattern, but not the content. The best part of
Web services and SOAP is that its all sent via HTTP, which is the standard web protocol. SOAP message consists of - Each SOAP document needs
to have a root element known as the <Envelope> element. The root element is the first element in an XML document. The header contains the routing
data which is basically the information which tells the XML document to which client it needs to be sent to. The body will contain the actual message.
RESTful Web Services are basically REST Architecture based Web Services. In REST Architecture everything is a resource. RESTful web services are
light weight, highly scalable and maintainable and are very commonly used to create APIs for web-based applications. This tutorial will teach you the
basics of RESTful Web Services and contains chapters discussing all the basic components of RESTful Web Services with suitable examples.

WSDL (Web services description language) - A web service cannot be used if it cannot be found. The client invoking the web service should know
where the web service actually resides. Secondly, the client application needs to know what the web service actually does, so that it can invoke the right
web service. This is done with the help of the WSDL, known as the Web services description language. The WSDL file is again an XML-based file which
basically tells the client application what the web service does. By using the WSDL document, the client application would be able to understand where
the web service is located and how it can be utilized.

Deployment - is the process of getting your program ready for market. A newly created program may work fine on your computer, but that doesn’t mean
it is really ready for others to use. There are many extra program features you probably hadn’t needed for yourself, but ought to provide if the program
will be used by others. There are two categories of ASP.NET deployment:- Local deployment : In this case, the entire application is contained within a
virtual directory and all the contents and assemblies are contained within it and available to the application. Global deployment : In this case,
assemblies are available to every application running on the server. There are different techniques used for deployment - XCOPY deployment means
making recursive copies of all the files to the target folder on the target machine. XCOPY deployment simply copies the application file to the production
server and sets a virtual directory there. Copying a Website -The Copy Web Site option is available in Visual Studio. It is available from the Website -
> Copy Web Site menu option. This menu item allows copying the current web site to another local or remote location. Creating a Setup Project - In
this method, you use Windows Installer and package your web applications so it is ready to deploy on the production server. Visual Studio allows you to
build deployment packages.

Remote Procedure Call (RPC) defines a powerful technology for creating distributed client/server programs. The RPC runtime libraries manage most of
the details relating to network protocols and communication. This enables you to focus on the details of the application rather than the details of the
network. In RPC, the caller and sender process are executed on different machines, they can communicate with the help of the transport and network
layers of an OSI model. Initially the caller process sends a request message with procedure parameters to the server process. Then, the caller process
gets into the wait state until some reply not come from server process. A process on the server side will extract the call message with procedure
parameters, it will then compute the result and sends a reply message back to the caller process. [ namespace server_test {class Program { static
void Main(string[] args) { try { IPAddress ipaddress = Address. Parse("192.168.119.1"); TcpListener mylist = new TcpListener(ipaddress, 8000);
mylist.Start(); Console. WriteLine ("Server is Running on Port: 8000"); Socket s = mylist.AcceptSocket(); int k = s.Receive(b); Console. WriteLine
(Recieved.."); } catch (Exception ex) } }

Delegate is a reference type and a type-safe function pointer that references methods using their memory addresses and invokes them dynamically at
the run time of the program. A delegate has a specified set of parameters and a return type like a method and it invokes a method that has the matching
parameters and a return type. It means that the parameters and the return type of a delegate must be the same as the parameters and the return type of
a method it references to. The delegates are actually the .NET implementation of function pointers and they are object-oriented, type safe and secure
unlike C++ functions pointers. Therefore, we can say that delegates are the .NET reference objects. To invoke a method using a delegate we must use
the following three steps:- 1) Declare a Delegate Type 2) Instantiate a Delegate Instance. 3) Invoke the Method. Types of Delegates – 1) Single
Cast Delegate is a type of delegate that references to a single method at a time. A single cast delegate holds the reference or the memory address of a
single method that has the matching parameters and a return type. [public delegate int myDelegate(int x); ] 2) multicast delegate is a type of the
delegate that references and invokes multiple methods at the same time. An instance of the multicast delegate reference type holds the references or
the memory addresses of multiple methods that have the same parameters lists and the same return types .
Boxing and unboxing is a essential concept in C#'s type system. With Boxing and unboxing one can link between value-types and reference-types by
allowing any value of a value-type to be converted to and from type object. Boxing and unboxing enables a unified view of the type system wherein a
value of any type can ultimately be treated as an object.
boxing conversion permits any value-type to be implicitly converted to the type object or to any interface-type implemented by the value-type. Boxing a
value of a value-type consists of allocating an object instance and copying the value-type value into that instance. [ using System; class GFG { static
public void Main(){int num = 2020; object obj = num; num = 100; System.Console.WriteLine("Value - type value of num is : {0}", num);
System.Console.WriteLine ("Object- type value of obj is:{0}",obj);}}
unboxing conversion permits an explicit conversion from type object to any value-type or from any interface-type to any value-type that implements the
interface-type. An unboxing operation consists of first checking that the object instance is a boxed value of the given value-type, and then copying the
value out of the instance. [using System; class GFG { static public void Main() { int num = 23; object obj = num; int i = (int)obj;
Console.WriteLine("Value of ob object is : " + obj); Console.WriteLine("Value of i is : " + i); } } ]

Java & .Net Similar - C#.Net and Java both are the programming languages, which are most popular and widely used. 1) C# and Java both are the
object oriented programming languages. 2) C# and Java both are the languages descended from C and C++. 3) Both C# and Java compilers generate
an intermediate language code after compilation. 4) Both languages include advanced features, like garbage collection, which remove some of the low
level maintenance tasks from the programmer. 5) In a lot of areas they are syntactically similar.
Differences: - 1) C# developed by Microsoft, while Java developed by sun-microsystem. 2) Founder of C# is Anders Hejlsberg. And Founder of JAVA is
James Gosling. 3) C# contains more fundamental data types than Java, and also allows more extension to the value types. 4) Java does not support
operator overloading while C# supports operator overloading of multiple operators. 5) C# uses CLR (Common Language Runtime) while JAVA uses
JVM (Java Virtual Machine).
Reflection objects are used for obtaining type information at runtime. The classes that give access to the metadata of a running program are in the
System.Reflection namespace.The System.Reflection namespace contains classes that allow you to obtain information about the application and to
dynamically add types, values, and objects to the application. Reflection has the following applications − It allows view attribute information at runtime. It
allows examining various types in an assembly and instantiate these types. It allows late binding to methods and properties.

interface looks like a class, but has no implementation. The only thing it contains are declarations of events, indexers, methods and/or properties. The
reason interfaces only provide declarations is because they are inherited by structs and classes, that must provide an implementation for each interface
member declared. In C#, an interface can be defined using the interface keyword. For example, the following is a simple interface for a logging string
message: [ interface ILog { void Log(string msgToLog); } ] exa – [using System; using System.Collections.Generic; using System.Linq; using
System.Text; namespace InterFaceDemo { class Program { static void Main(string[] args) { console.WriteLine("This is ODD"); IFive obj1 = new
ODDEVEN(); obj1.ONE(); obj1.THREE(); obj1.FIVE(); Console.WriteLine("\n\nThis is EVEN"); IEVEN obj2 = new ODDEVEN(); obj2.TWO();
obj2.FOUR(); Console.ReadLine(); } }} ]

Exception is a problem that arises during the execution of a program. A C# exception is a response to an exceptional circumstance that arises while a
program is running, such as an attempt to divide by zero. Exceptions provide a way to transfer control from one part of a program to another. C#
exception handling is built upon four keywords: try, catch, finally, and throw. Following are some scenarios where an exception occurs- A user has
entered an invalid data. A file that needs to be opened cannot be found. A network connection has been lost in the middle. Following is an example of
throwing an exception when dividing by zero condition occurs – [using System; namespace ErrorHandlingApplication { class DivNumbers {int result;
DivNumbers() { result = 0; } public void division(int num1, int num2) { try { result = num1 / num2; } catch (DivideByZeroException e) {
Console.WriteLine("Exception caught: {0}", e); } finally {Console.WriteLine ("Result: {0}", result); } } static void Main(string[] args) { DivNumbers d = new
DivNumbers(); d.division(25, 0); Console. ReadKey(); } }} ] [Result: 0 ]

C# Structure - C# is a simple, modern, general-purpose, object-oriented programming language . C# programming is very much based on C and C++
programming languages, so if you have a basic understanding of C or C++ programming, then it will be fun to learn C#. A C# program consists of the
following parts − Namespace declaration, A class, Class methods, Class attributes, A Main method, Statements and Expressions, Comments. Exa –
[using System; namespace helloWorld { class HelloWorld { static void Main(string[] args) Console.WriteLine("Hello World"); Console.ReadKey(); }}} ]
Let us look at the various parts of the given program − The first line of the program using System; - the using keyword is used to include the System
namespace in the program. The next line has the namespace declaration. A namespace is a collection of classes. The next line has a class
declaration, the class HelloWorld contains the data and method definitions The next line defines the Main method, which is the entry point for all C#
programs. The last line Console.ReadKey(); is for the VS.NET Users. This makes the program wait for a key press and it prevents the screen from
running and closing quickly .

You might also like