blog posts

How to process ASP.NET requests in IIS web server

When a request arrives from the client to the server side, many processes are done on the request by IIS before sending the response to the user. This article does not attempt to describe the Page Life Cycle of ASP.NET pages and is entirely related to IIS-level processes.

The list of this article (by clicking on any title, you will be transferred to that part) Hidden
What is a web server?
What is IIS?
How to process requests

Before getting into the details, we first introduce the basic concepts so that everyone with any level of knowledge can understand all the relevant details.

What is a web server?

When you run your ASP.NET web application in the Visual Studio environment, the Integrated ASP.NET Engine is responsible for processing all ASP.NET requests and responses. It is the WebDev.WebServer.Exe processor that is responsible for tracking the request and response of the web application running in the Visual Studio environment.

When we host our application in a central place with the possibility of access from anywhere in the world, the name of Web Server comes in. To get more information in this field, we suggest our article What is a web server issue? Read for information in this field.

What is a web server?

Before you want to work with asp.net, you should be familiar with topics such as HTML and scripting languages ​​such as javascript and Vbscript.

What is the asp.net programming language?

Before we want to answer this question, we need to know what ASP stands for. This three-letter word is derived from the term Active Server Page. Of course, it should be said that asp.net is not a programming language and is actually a free web development technology that comes from net. It is used to build web applications and websites.

web application in the article What is a web application ? Read more about

ASP programming language uses Microsoft technologies and is a scripting language that runs in IIS. ASP.NET is the new generation of ASP. The prerequisites for running IIS are Windows NT 0.4 and later versions. To run PWS, you need to have Windows 95 or later. PWS is a smaller but complete version of IIS. This service is included in Windows 95 and later.

ChiliASP is a technology that runs asp without the need for Windows operating systems.

InstantASP is another technology that runs ASP without Windows.

What is the asp.net programming language?

What is the difference between asp language and asp.net language?

So far you know what is asp.net, now it’s time to look at the differences between ASP and ASP.net languages.

The first case: In response to what is asp, it should be said that it is a web technology for developing and creating dynamic content, which is based on one of the script languages ​​such as Vb Script or Java Script. (Scripting languages ​​are smaller and weaker examples of their original and basic languages. Vb Script is derived from Visual Basic and Java Script is derived from the Java language). So, as you can see, ASP’s power is summed up in the power and ability of these two scripting languages.

But in the definition of the asp.net language, it should be said that the asp.net programming language was created based on Microsoft’s .Net technology , based on which all languages ​​that are compatible with this .NET platform can create dynamic Asp.net pages. be used Languages ​​like #C, Java, Visual Basic and… As it is known, the power of these languages ​​(especially #C) cannot be compared with script examples and has higher power and flexibility.

The second case: in asp.net technology, page layout is generally separate from coding and is completely composed of two different layers. In this way, the programmer will be able to use a design scheme or a piece of code in different projects many times without the least interference and the need to change and adapt, which is the biggest advantage of this technology over classic Asp, where the programmer every time He has to write a lot of code manually.

There are many editing and development environments for the .Net environment, the most powerful and famous of which is Visual Studio .Net, which largely eliminates the need for manual coding through its strong user interface. Unfortunately, there is no special environment for asp, and environments like Front Page or Dreamweaver are used in most cases. to get information about what Dreamweaver is . Read our article

The third case: the extension of asp files as asp. and the extension of Asp.Net files as aspx. is.

The fourth case: in the asp.net language due to the programmer’s benefit from the powerful Net library. , almost anything is possible and there is no need to use additional components most of the time. Unlike Asp, which requires a specific package or component for each specific activity. For example, to send an email, the software package used by the programmer must be installed on the server, otherwise it will not be possible to use it.

And in the end, it is generally easier to learn the ASP language than its newer example, namely ASP.Net, and the reason for this is that it is easier to learn scripting languages. But in general web programmers are moving towards newer .Net technology. are.

What is an asp file and its types of extensions

In response to what is an asp file, it should be said that this file is completely similar to an HTML file. The content of this file can include Text, Html, XML, Script.

The scripts in the ASP file are executed on the server. The extension of this file is asp. but in the topic of website design with the help of ASP, it should be noted that the extensions of the ASP file will be different depending on their composition. for example:

The classic ASP file has the extension asp. is and can also be with the file extension aspx. to appear

If ASP.net is combined with #Razor C, the cshtml file extension. is

and finally the file extension vbhtml. which is created when combining ASP.NET with Razor VB.

What are the differences between html and asp?

When the browser requests an HTML file, the server returns the file. But when the browser requests an ASP file, IIS sends the request to the ASP engine and the ASP engine reads the asp file line by line and executes the scripts in the file. Finally, the asp file with the html version is sent to the browser. returns

What is the use of asp.net?

If we want to say what is the use of Asp.net, we can briefly refer to the following list:

  • It dynamically adds, changes or edits any web content.
  • Respond to user queries or data in forms.
  • Accesses the database or data and returns the results to the browser.
  • Customize web pages to be useful for users.
  • The advantage of using ASP instead of CGI and PERL is its simplicity and high speed due to the lack of classes.
  • Having security, because the ASP codes cannot be seen through the browser.
  • Programming with ASP can also reduce network traffic.

You are suggested to read our article to get information about learning ASP.Net .

Install asp software

Now that you know what ASP.NET is, it’s time to get ready to install ASP software.

If you install IIS or PWS, your PC system can act like a web server, these two components are free.

asp.net programming language

نصب IIS (Internet information server ) :

IIS is a set of built-in server services designed by Microsoft for Windows.

IIS exists in Windows XP, Vista, Windows 7. It can also be used for Windows NT.

install PWS (PERSONAL WEB SERVER):

This service exists for old Windows such as Windows 95, 98 and NT.

Of course, it is easy to install and used for developing and testing ASP web applications. It is suggested to use it only for training due to security reasons and being old.

The different versions of Windows along with the version of IIS that they support are as follows:

Windows 7 (all editions) come with IIS 7.5

Windows Vista Business, Enterprise and Ultimate come with IIS 7

Windows Vista Home Premium comes with IIS 7

Windows Vista Home Edition does not support PWS or IIS

Windows XP Professional comes with IIS 5.1

Windows XP Home Edition does not support IIS or PWS

Windows 2000 Professional comes with IIS 5.0

Windows NT Professional comes with IIS 3 and also supports IIS 4

Windows NT Workstation supports PWS and IIS 3

Windows ME does not support PWS or IIS

Windows 98 comes with PWS

Windows 95 supports PWS

A normal ASP file contains HTML tags, but the programming languages ​​that can be used to generate ASP files include the following:

The default script language is Vbscript, the <%@ language=”javascript”%> tag is used to specify the language type. Another language is Jscript. If you want to use other languages ​​such as PERL, Pexx, Python, you must install their corresponding script engines

 What is IIS?

IIS (Internet Information Server) is one of Microsoft’s most powerful web servers used to host your ASP.NET web application.

IIS has its processing engine to handle ASP.NET requests, so when a request is sent from the client to the server, IIS receives and processes the request and sends the response to the client.

It is recommenWe recommend readingo get information about what asp.net is.

What is IIS?
What is IIS?

How to process requests

Before explaining how requests are processed in the web server and IIS, you must be familiar with the following two concepts.

. Worker Process

. Application Pool

Worker Process: The ASP.NET application is executed in IIS by Worker Process ( w3wp.exe ). The process worker manages all received requests and responses sent to the client system. All ASP.NET features are implemented under the Worker Process domain.

When a request arrives from the client system to the web server, the worker process takes responsibility for creating the request and responding to it. The Worker Process is the heart of the ASP.NET web application in IIS.

Application Pool: In simple language, the application pool is a container that houses Worker Process.

Application Pool separates the worker process/worker processes that share the same configuration from other Worker Processes. Each worker process/worker process with the same configuration is executed in its own separate Application Pool. Application Pool security, capability It provides more reliability and availability for each web application in such a way that it creates a border between the Worker Processes (because each Worker Process is executed in its own separate Application Pool) and in the event of a problem or the Recycle of a Worker Process. It will not affect other Worker Processes and ensure that no web application can disrupt the functioning of other web applications because each one is configured in its own Application Pool.

ASP.NET

Application Pool

An Application Pool with several Worker Processes running simultaneously inside it is called a Web Garden.

Up to this point, we have described all the necessary basic concepts such as Web Server, Application Pool, and Worker Process, and now we can check how IIS processes when a new request arrives from the client side.

IIS processing

IIS processing

According to the architecture and structure of IIS, we can divide it into two layers:

Kernel Mode

 User Mode

Kernel Mode, introduced with the advent of IIS6, is in the HTTP.SYS service vector. When a request is sent from the client to the web server, it will reach the HTTP.SYS service is the first step.

After receiving the request by the HTTP, the SYS service, this service is responsible for referring the request to the relevant Application Pool. The question that arises here is how HTTP. Does SYS know where to send the request?

The selection is not random because each request is related to a specific web application and must be referred to the Application Pool specific to that web application.

The Pool Application ID is created and registered in HTTP whenever an Application Pool is created.SYS. Therefore, whenever HTTP.SYS receives requests related to a web application; it finds the relevant Application Pool and forwards the request accordingly.

ASP.NET
HTTP.SYS service

This was the first step in the client’s “request processing” process in IIS.

So far, the client has requested to receive information/pages, and this request has reached the Kernel Level layer in IIS, i.e., HTTP.SYS, and HTTP.SYS has determined which Application Pool the request should be sent to. Now we need to see how this request is transferred from the HTTP.SYS layer to the relevant Application Pool.

In the User Level layer of the IIS web server, we have the Web Admin Services ( WAS ) service, which receives the request from HTTP.SYS and transfers it to the relevant Application Pool