ASP.NET请求生命周期的困惑 [英] ASP.NET request lifecycle confusion
问题描述
我是新来的C#和.NET,并从一个Java的背景来啦。我试图让我的头周围做Web应用程序的.NET的方式和我没有多少运气。
I am new to C# and .Net and am coming from a Java background. I am trying to get my head around the .NET way of doing web applications and am not having much luck.
我想建立一个应用程序来处理请求的URL和写回的图像响应。
在Web应用领域有只用Java小我后处理应用程序的请求方一些很好的资源和/或解释。
I want to build an application to handle requests urls and write responses that return images. Having only used Java servlets in the web application field I am after some good resources and/or explanations on handling the request side of the application.
如何申请办理?与哪些对象?什么是循环?如何围绕页面此功能?
How are requests handled? and with what Objects? What is the cycle? how do pages function around this?
这些都是基本的广泛的问题,所以如果有人知道的资源,涵盖所有这些彻底请让我知道。什么到目前为止,我已经找到了比特的信息不大局。
These are basic broad questions so if anyone knows of resources that covers them all thoroughly please let me know. What I have found so far has bits of information not the overall picture.
推荐答案
整个页面周期是复杂的 - 但对于提供图像,您可能希望在主要看的IHttpHandler
接口 - 或(更简单)创建一个通用处理器(ashx的文件)。在的IHttpHandler
是最简单的请求/响应的设置,没有.aspx页的负担;您只需从context.Request读取和写入context.Response。
The overall page cycle is complex - but for serving images, you may want to look primarily at the IHttpHandler
interface - or (more simply) create a "generic handler" (.ashx file). The IHttpHandler
is the simplest "request/response" setup, without the burden of .aspx pages; you simply read from the context.Request, and write to the context.Response.
这篇关于ASP.NET请求生命周期的困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!