ihttphandler

Problem implementing Paul Johnson's Web Widget code, it works in VS 2008 but not in deployment to IIS 6.0

Using the instructions from Paul Johnson's Web Widgets page I created my own custom widget. However because I was deploying to IIS 6.0 I utilized the web.config change recommended to render the page since the IIS 7.0 configuration management option was not available in IIS 6.0. The widget renders correctly when debugging with VS 2008. ...

ASP.net IHttpHandler to execute .aspx file

What is the proper to make an IHttpHandler to have an existing .aspx page process the request? I would like to be able to compile the .aspx file into an IHttpHandler and then have it process the request. There is the PageParser.GetCompiledPageInstance method, however in the documentation it states its not for direct use from code. I know...

Problem using IHttpHandler

I want to capture all the requests goin to *.jpg files on my server. To do so I have created HttpHandler whose code is as follows using System; using System.Collections.Generic; using System.Text; using System.Web; using System.IO; using System.Globalization; namespace MyHandler { /// /// Summary description for NewHandler. ...

IHttpHandler Example required for Image Type Files C# ASP.Net

Can anyone provide a good example of IHttpHnalder for handling Image Type. I want to resize the image that's hosted on my server ...

HttpContext and writing a component for both WebForms and MVC

I'm writing a component that I would like to be able to use in both MVC and WebForms web apps, but I'm not sure how to handle the differences between how HttpContext is handled. My component involves a custom IHttpHandler (for WebForms) or a custom ActionResult (for MVC). So I've got a few questions: Is there a way to use an IHttpHan...

Set .ashx as start "page" for web application

Is it possible to set an .ashx file as the starting (or default) page for a web application? If so, how is it done? Edit - Some good suggestions. I have added "Default.ashx" to the IIS Default Documents and "Enabled Default Document" on the website, however, it only displays a directory listing even though I have disabled directory br...

Difference asp.net web service and Ihttphandler

Simple task like make AJAX request , pass one parameter and return result, can be done with Web Service and IHttpHandler, so where is the difference ? ...

IHttpHandler that handles all URL extensions in IIS 6, IIS 7 and ASP.NET Development Server

We have a custom IHttpHandler that is responsible for file downloads. The handler is mapped to URL /downloadfile.rem The browser redirects user to URL formatted like: /downloadfile.rem/[fileID]/[mimeType]/[fileName].[extension] example: /downloadfile.rem/54923876129874545456621/text$plain/data.txt Our handler gets the supplied informa...

Significance of bool isreusable in http handler interface

When writing a http handler/module, there is an interface member to implement called - bool Reusable. What is the significance of this member? If I set it to false (or true), what does this mean for the rest of the web app? Thanks ...

Static files and authentication in ASP.net

Hi! Say I have a virtual folder /topFolder/ in IIS7, and in that folder there can be any file that can be displayed in a browser (xml, html, swf, doc etc - typically "unmanaged" resources from the IIS perspective). Before giving the request permission to open any file below the folder, I need to check some session variables in order to...

HttpHandler instance and HttpApplication object - does the latter...?

A Book showed an example where ( when using IIS7 ) the following module was configured such that it would be used by any web application ( even by non-asp.net apps ) running on a web site. But: A) if this module is invoked for non-asp.net application, then how or why would HttpApplication object still be created, since non-asp.net apps ...

Accessing the original HTTP request packet in an IHttpHandler

I am trying to write an IHttpHandler that can work with a request for streaming media coming from Windows Media Player/Silverlight. That means responding to a raw HTTP request like this (taken from the protocol document) "GET /ms/contoso_100_files/0MM0.wmv HTTP/1.0" "Accept: */*" "User-Agent: NSPlayer/4.1.0.3925" "Host: netshow.micro.c...

Sending file over HttpContext causes browser to hang

I am sending a file to the user using a HttpHandler. On all browsers, after viewing/downloading the file at least once, the browser/application on subsequent views/downloads hangs. Here is the code: private void TransmitFile(HttpContext context, string filePath, string downloadName, bool forceDownload) { if (File.Exists(...

Bind XMLDataSource to HTTP handler

Hi I have some dynamically generated XML data that will be consumed by a few consumers (An ASPX page, a flash file and maybe another one as well). I have implemented it as a custom handler. I construct the XML in the handler and output it using response.write. Now If I set the DataFile property of my XMLDataSource to the handler, it ...

IHttpHandler to post to a form

Is it possible to post to a form from pure code behind in ASP.NET? Basically I need to simulate a Response.Redirect() but do so with a POST instead of a GET and also set a couple Request parameters. This would all be happening in the ProcessRequest method on a HTTP handler. Notes: I realize that Response.Redirect really just throws the ...

Image from HttpHandler won't cache in browser

I'm serving up an image from a database using an IHttpHandler. The relevant code is here: public void ProcessRequest(HttpContext context) { context.Response.ContentType = "image/jpeg"; int imageID; if (int.TryParse(context.Request.QueryString["id"], out imageID)) { var photo = new CoasterPhoto(imageID); if (pho...

IHttpHandler for images producing a stackoverflow in IE

I have a directory of images that reside outside the context of my web application that I need to serve to the user. Currently I'm using an IHttpHandler to serve the images and using some javascript to navigate through a set of images (the navigation is primitive for now). I followed examples for using IHttpHandler to serve images closel...

ASP.NET: How to access Session from handler?

i'm trying to store some values in the Session from a Handler page, before i do a redirect to a WebForms page, that will pick up the Session values and pre-fill the WebForm: public class Handler : IHttpHandler { public void ProcessRequest(HttpContext context) { ... context.Session["StackOverflow"] = "overflowing"; ...

ASP.NET HttpHandlers and scriptProcessor path on web.config

I'm defining http handlers on my web.config: <add name="nsi" path="i.nsi" verb="GET" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0" /> The scriptProcessor points to the Framework64 f...

How do I get a custom IHttpHandler to Be Capable of Handling Postbacks?

I am writing a custom HTTP handler to provide an edit form for a grid using existing user controls. Basically, my handler creates the page, form, header, and other controls necessary to be able to render the existing user controls properly and at the end of ProcessRequest, I use Server.Execute to execute the page that was dynamically cr...