ASP.NET 请求生命周期混乱

发布于 2024-07-21 22:20:10 字数 303 浏览 4 评论 0 原文

我是 C# 和 .Net 新手,有 Java 背景。 我正在尝试以 .NET 方式进行 Web 应用程序,但运气不佳。

我想构建一个应用程序来处理请求 url 并编写返回图像的响应。 我只在 Web 应用程序领域使用过 Java servlet,因此我需要一些关于处理应用程序请求端的良好资源和/或解释。

如何处理请求? 以及什么对象? 什么是周期? 页面如何围绕这个运作?

这些是基本的广泛问题,因此如果有人知道彻底涵盖所有这些问题的资源,请告诉我。 到目前为止,我所发现的只是一些信息,而不是整体情况。

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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

生生不灭 2024-07-28 22:20:10

整个页面周期很复杂 - 但对于提供图像,您可能希望主要查看 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.

记忆消瘦 2024-07-28 22:20:10

如果只提供图像,请查看 HttpHandlers。

至于页面生命周期:我喜欢这张图片: EggHeadCafe
(来源:eggheadcafe.com

FOr serving up just image have a look HttpHandlers.

As for Page life cycles: I love this image: EggHeadCafe
(source: eggheadcafe.com)

鞋纸虽美,但不合脚ㄋ〞 2024-07-28 22:20:10

此概述将解释页面生命周期、页面(ASPX 页面) ) 是 ASP.NET 中的默认 HTTP 处理程序。

但还有其他方法可以处理 HTTP 调用。 此资源将解释 .NET 如何处理HTTP 调用,以及 ASPX 页面默认如何处理它们。

干杯

This overview will explain the Page life cycle, Page (an ASPX page) being the default HTTP handler in ASP.NET.

But there are other ways to handle HTTP calls. This resource will explain how .NET can handle HTTP calls, and how ASPX Pages handle them by default.

cheers

離殇 2024-07-28 22:20:10

这里是描述页面生命周期的好起点。

对于您的其他问题,我实际上建议您买一本书并坐下来阅读几个小时。 ASP.NET 2.0 核心编程参考已证明自己非常有价值。

This is a good place to start for a description of the page lifecycle.

For your other questions, I'd actually recommend you get a book and sit back for a few hours with it. Programming ASP.NET 2.0 Core Reference has proved itself very valuable.

木落 2024-07-28 22:20:10

网站 asp.net 包含大量帮助您入门的信息。 学习部分是一个很好的起点。

当然,MSDN 有很多信息。 您可能会感兴趣的几篇文章和页面:
- ASP.NET 页面生命周期概述
- 创建 ASP.NET 网页

在阅读 MSDN 上的文本时,检查左侧的树结构以获取更多内容。

The site asp.net contains a lot of information to get you started. A good starting point is the learning section.

MSDN has lots of information, of course. A couple articles and pages you may find interesting:
- ASP.NET Page Lifecycle Overview
- Creating ASP.NET Web Pages

When reading the texts on MSDN, check the tree structure to the left for more content.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文