httphandler

Ashx handler cannot be used through an <asp:Image> control

Hello all, In an ASP.NET 3.5 application, I have created an ashx handler as below: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.IO; using System.Web.Services; namespace TestWebConfig { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfil...

Custom HttpHandlers and different handler types.

All literature I see on creating custom handlers deals with associating an extension with a handler, e.g. if I wanted a handler for Ajax requests, I could implement the IHttHandler interface in an AjaxHandler class. Now, to have individual instances of AjaxHandlers, e.g. DocAjaxHander, PersonAjaxHandler etc. how would I derive the base ...

HttpHandler using Default Namespace

I have a HttpHandler called Handler that I compile into a DLL and put in the /bin folder of my ASP.NET app. Then I have a .ashx file: <% @ webhandler language="C#" class="Handler" %> but I get a cannot create type 'Handler' error. However, if I wrap Handler in a gratuitous namespace, say foo, and change the .ashx to <% @ webhandler ...

Using a colon (:) in a url with ASP.NET/IIS

I'm implementing a custom controller in ASP.NET MVC and really want to be able to use a colon in the urls, so that I can identify class/column names and their values, like so: http://mysite.com/user:chaiguy ...but apparently ASP.NET or IIS doesn't allow colons in urls. I did some digging and apparently it's considered a security issue,...

Mapping specific folder to HttpHandler in web.config

Is it possible to map all file extensions in a folder to a specific HttpHandler (assuming that their file extensions are mapped to aspnet_isapi.dll in IIS) ? I've got the FLV extension mapped to ASP.NET in IIS, and have a folder named Static in my web application with the following files: Static/Index.htm Static/MyFile.flv The index...

Specifying exact path for my ASP.NET Http Handler

I generate an XML/Google sitemap on the fly using an Http Handler, so that I don't need to maintain an XML file manually. I have mapped my Http Handler to "sitemap.xml" in my web.config like this: <httpHandlers> <add verb="*" path="sitemap.xml" type="My.Name.Space, MyAssembly" /> </httpHandlers> It works nicely. Now, www.mywebsite....

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 ...

IIS7 file mappings - .asax, .ashx, .asap

Hello, IIS enables us to also configure Asp.Net file mappings. Thus besides aspx, IIS also invokes Asp.Net runtime, when requests have the following file extensions: a) .ascx --> .asmx extension is used to request user controls. Since user controls can’t be accessed directly, how and why would anyone send a request to a user con...

Diagnosing 404 errors on IIS 7 and ASP.NET MVC

I have an mvc app developed and tested with Cassini. Deployed to my site on GoDaddy, and the default page comes up fine. Click to log in, and I get a 404. I'm running under IIS 7 there, so this is unexpected. My routes are pretty plain: routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Def...

How do I find out which request path is missing in a 404 error handler in iis7?

I am trying to create a custom error handler in iis 7. web.config httpErrors section: <httpErrors> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" prefixLanguageFilePath="" path="/path/to/handlerwebservice" responseMode="ExecuteURL" /> </httpErrors> web.config httpHandler to handle error: <add path="*/...

How to register HttpHandler for all subfolders in Asp.Net?

I would like to register an HttpHandler to include all subfolders of a root folder regardless of how far down they are nested. I would have expected the behavior with the below code to do just that but in fact it only includes items directly in the root folder. <httpHandlers> <add verb="*" path="root/*" type="HandlerType, Assembly" /...

Mono 2.4 error: ' Feature `generics' is not available in Mono mcs1 compiler. Consider using the `gmcs' compiler instead'

Installed Mono 2.4 on Ubuntu using the instructions here: http://www.nabble.com/forum/PrintPost.jtp?post=22841086 When I run xsp and try to run http module (http://192.168.1.6:8080/album.ashx), I get the following errors: Compilation Error Description: Error compiling a resource required to service this request. Review your source fi...

Custom handler working on Asp.NET Development server but not on IIS 5.1??

Hi guys, ive got a stupid problem. My Custom handler is working 100% on Asp.NET Development server but when i publish the site to IIS 5.1 whenever i try to run Comment/Find (which finds a user via an AJAX call) (i know the naming of my handler sux!!! :) I get this error: The page cannot be displayed The page you are looking for canno...

Why can't I set an item in the HttpContext in a module then get it back in my handler?

In an HttpModule, I put an Item in the Context, like this: HttpContext.Current.Items.Add("MyKey", "Hello world!"); Directly under this code (still inside the module), I can retrieve this string from the collection, so I know it got added. Fast forward to my actual handler (a Web form -- .aspx). I try to get this item back: string my...

ASP.NET + Empty Response from WebServices / HttpHandlers

A few weeks ago, I posted a question saying that Update Panels had empty responses. I was unable to resolve it. However, today I noticed that webservices, and HttpHandlers also return nothing, IE this: public class Handler1 : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.ContentType ...

Do Asp.Net handlers pass data back to HttpResponse?

Hello, Q1: A) I assume web form passes rendered html to HttpResponse object, and in turn HttpResponse object passes these rendered data back to IIS? B) I also assume that regardless of which Asp.Net http handler processes the request, all Http handlers eventually pass data back to HttpResponse? Q2 - When request is received by...

IHttpHandler vs IHttpModule

My question is simple (although the answer will most likely not be): I'm trying to decide how to implement a server side upload handler in C# / ASP.NET. I've used both HttpModules (IHttpModule interface) and HttpHandlers (IHttpHandler interface) and it occurs to me that I could implement this using either mechanism. It also occurs t...

IIS 7 Default document setting for a mapped handler url

I have a web site that serves only one page from the root. The page (call it stuff.htm) is generated by a custom handler, and doesn't physically live on disk. I'd like stuff.htm to be the default doc for the site, but the standard configuration method of making it the default doc fails since the regular ASP.Net DirectoryListingModule is...

asp.net handlers and extensions - am I doing it incorrectly?

I have a requirement on my new project to serve up some "hidden" assets (actually just stashed in the App_Data directory) after a certain date. Before then, they should act like they aren't there. I've done this kind of thing a hundred times with Page object, but as I started work on this, I thought I'd look into handlers. Having neve...

How do I pre-empt IIS StaticFileHandler with my own HttpHandler

Hi there, I'm building a website referencing an assembly that contains several js scripts as embedded resources, some controls which use those scripts and a 'HttpResourcesHandler' that knows how to retrieve those embedded scripts when asked for them. In web.config I have an entry in the section that reads <add verb="*" path="...