Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

FOr serving up just image have a look HttpHandlers.

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

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

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top