I am very new to Handlers, so please forgive my ignorance. I am trying to achieve the seemingly impossible, but I have been assured by people that this is possible. I am looking for any pointers that anyone can offer on how to even begin tackling this. This
is what I need to do: 1) A request comes in in the form of say "somefile.xyz?id=1". 2) Instead of serving this file directly, there needs to be some kind of mapping mechanism which tells the server that the real file we are after is a different one. The mapping
can be anything, e.g. some database lookup based on the ID in the URL. 3) The server then locates this file, which would contain normal ASP.NET code, first executes it by passing it through its normal process and then serves it. The process above needs to
be completely transparent to the user, in other words I can't use something simple as redirect to the page to be processed. I hope the above make sense.
No problem at all. Just go ahead and create a handler, register the handler in web.config, configure the extension in IIS (and make sure that the "check that file exists" checkbox is disabled, since the requests are done against non-existing virtual files).
In the HttpHandler, you can use Server.Transfer to transfer the request server-side to the right file on the server.
None
0 Points
1 Post
Executing and serving a different file than the one requested
Dec 15, 2004 12:36 PM|evagoras|LINK
None
0 Points
1617 Posts
Re: Executing and serving a different file than the one requested
Dec 19, 2004 11:05 AM|bdesmet|LINK
Visit www.msdn.be, www.bartdesmet.net