如何在浏览器上将asp控件呈现为html [英] how the asp control is rendered to html on browser

查看:76
本文介绍了如何在浏览器上将asp控件呈现为html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我拖放一个asp.net控件或使用kendo ui小部件时,他们如何能够生成浏览器能够理解和呈现的html代码?

任何简单的例子都适用于我。

when I drag and drop an asp.net control or use kendo ui widget how they are able to produce the html code that browser is able to understand and render?
any simple example would work for me.

推荐答案

ASP.Net中的每个控件都有自己的 Render 方法,该方法创建应该是的HTML发送到浏览器。此方法使用 HtmltextWriter 来执行此操作。我没有研究ASP.Net代码的内部,所以无法真正为您提供确切的细节。但是,您可以查看参考源 [ ^ ]。在链接页面中,您可以看到渲染网格视图的工作量。



AFAIK,如果您使用IIS来托管ASP.Net应用程序, IIS向 aspnet_isapi.dll 发送请求,然后将其传递给工作进程。以下摘自 MSDN [ ^ ]。



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

ASP.NET ISAPI扩展是Win32 DLL,不承载托管代码。它是中央控制台,用于接收和分派各种ASP.NET资源的请求。按照设计,该模块位于IIS进程中,并在具有管理权限的SYSTEM帐户下运行。开发人员和系统管理员无法修改此帐户。 ASP.NET ISAPI扩展负责调用ASP.NET工作进程(aspnet_wp.exe),后者又控制请求的执行。除了请求路由之外,ASP.NET ISAPI还监视工作进程的运行状况,并在性能降低超过某个阈值时负责将其终止。

工作进程是一个小的Win32 shell托管公共语言运行库(CLR)并运行托管代码的代码。它负责处理ASPX,ASMX和ASHX资源的请求。在给定的机器上通常只有一个这个过程的实例。所有当前活动的ASP.NET应用程序都在其中运行,每个应用程序都位于单独的AppDomain中。如前所述,工作进程支持Web园模式,这意味着进程的相同副本在所有CPU上运行,并且与进程具有亲缘关系。 (稍后将在网络花园模型部分中详细介绍。)

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.)


这篇关于如何在浏览器上将asp控件呈现为html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆