Each control in ASP.Net has its own
Render
method that creates the HTML that should be sent out to browser. This method uses
HtmltextWriter
to do so. I have not studied the internals of ASP.Net code so cannot really provide you with exact details. However, you can take a look at
Reference Source[
^] provided by MS. Here in the linked page, you can see how much work goes on to render a gridview.
AFAIK, if you have used IIS to host your ASP.Net application, IIS sends out request to
aspnet_isapi.dll
which then passes it on to worker process. Here is an excerpt from
MSDN[
^].
MSDN
The ASP.NET ISAPI extension is a Win32 DLL and does not host managed code. It is the central console that receives and dispatches requests for a variety of ASP.NET resources. By design, the module lives in the IIS process and runs under the SYSTEM account with administrative privileges. This account cannot be modified by developers and system administrators. The ASP.NET ISAPI extension is responsible for invoking the ASP.NET worker process (aspnet_wp.exe) which, in turn, controls the execution of the request. In addition to request routing, the ASP.NET ISAPI monitors the health of the worker process and is responsible for killing it when the performance degrades beyond a certain threshold.
The worker process is a small Win32 shell of code that hosts the common language runtime (CLR) and runs managed code. It takes care of servicing requests for ASPX, ASMX, and ASHX resources. There is generally only one instance of this process on a given machine. All currently active ASP.NET applications run inside of it, each in a separate AppDomain. As mentioned earlier, though, the worker process supports the Web garden mode, meaning that identical copies of the process run on all of the CPUs with affinity to the process. (More on this later in "The Web Garden Model" section.)