httphandler

ASP.NET Serving Word Documents

I have an application that has a subfolder called "Docs" (actually a virtual directory) where I keep all of my word documents. I don't want these documents to be accessed by any unauthenticated users but for some reason regardless of what I put in my root web.config or my "Docs" web.config IIS still serves the word up to any user. ...

How can I use Session variable in an HttpHandler

Goal: I have a thumbnail as a byte array in memory. Once a user uploads their image, I want to display it in an httphandler before writing it to the database. I have used this code to successfully read it and display from a database. But now I want to display it from the session: Public Sub ProcessRequest(ByVal context As HttpContext) _...

http handler compression over iis

I found this article http://archive.webproasp.com/webproasp-27-20080620CompressingWebResourceaxdtoReduceYourWebsiteSize.html and it explains how to compress axd files (and js files). I wondered if there is any advantage in doing this over letting IIS handle the compression. ...

How to see if IIS is actually sending requests to ASP.Net?

I have setup in the script maps for a site in the IIS metabase a wildcard mapping to ASP.Net for a particular directory within the site. I have a handler setup in the web.config which should be handling requests for said path and it should never return an actual 404. I have this configuration in place for another site on the same serve...

Endless loop when calling an HttpHandler

I’ve built an HttpHandler (ASHX) that sits in my web project. I have a test page that invokes the Handler and the Handler returns what it is supposed to. However, as soon as the return is done it gets invoked again. And again, and again, and again, ad naseum. Any thoughts on what might cause this type of behavior? The test page look...

Mapping not being recognised in IIS 6 for HTTP Handler

I've created a HTTP Handler to prevent users from accessing unauthorized streaming ".flv" files. It implements the IHttpHandler interface, is referenced in the Web.Config and works when I map an extension to ".pdf", but when I add the ".flv" the mapping in IIS, the app still seems ignored it (even though everything else is the same as i...

How do I get the MIME type of a file being requested in ASP.NET C#?

I would like to handle requests differently depending upon the MIME type. For example, I have PDF's, images and other media files that I would like to prohibit access to based on their respective MIME types. Any ideas on how to do this? Thanks for the help. I should also note that accessing the Windows registry is not an option for my a...

HttpHandler not working on site using different port

I wrote a tiny HttpHandler, which works beautifully on my machine. However, once it was deployed to our staging server, requesting it gave an 404. I usually prefer configuring HttpHandlers in web.config, but this apparently didn’t work on the server: I fixed it by creating an .ashx file containing just the reference to my HttpHandler. T...

How can Request Validation be disabled for HttpHandlers?

Is it possible to disable request validation for HttpHandlers? A bit of background - I've got an ASP.NET web application using an HttpHandler to receive the payment response from WorldPay. The IIS logs show that the handler is being called correctly from WorldPay, but the code inside the handler is never called. If I create a physical...

Response.Redirect in HttpModule

Can I do a redirect to a custom page in an HttpModule? I have an HttpModule A which executes some javascript code when any aspx page is loaded. I would like to have a server side code check to see if the clients browsers supports cookies. Can I place that code in the HttpModule A? If so, in which event? Or do I need to have a new HttpHa...

How to prevent ashx from resetting Session Timeout?

I'm having trouble finding any info on this, which makes me think I'm doing something wrong. I've made an ashx that serves up secured images to our logged-in users. The problem is that a Sql Profiler trace reveals that TempResetTimeout is called in our Session State DB for every image served via this mechanism. This ashx was built to ...

ASP.NET - Resolve Loaded HttpHandler Path

In ASP.NET is there any way to programatically resolve the path to a loaded HttpHandler as it is defined in the Web.config? (i.e. SomeModule.axd)? ...

Upload files using Google Gears and ASP.NET or PHP

Trying to upload files using Google Gears and ASP.NET... I assume you can as the HttpRequest API accepts blobs. I have FileUpload control in the page. <asp:FileUpload runat="server" ID="File1" /> Then the JavaScript var file1 = document.getElementById("<%# File1.ClientID %>"); var desktop = google.gears.factory.create('beta.desktop'...

Http Module & Http Handler is not firing when it is under a virtual directory of a ASP.NET website

Problem: There is a website(localhost:85) configure to C:\abc. I have created a seperate website which has HttpModule and HttpHandler in it. This new website should not be in the main application(C:\abc). So I have put a seperate folder like D:\xyz. And configured a virtual directory under port 85. Using ISAPI filter whenever related t...

Using jQuery with HttpHandlers

Hello, I am trying to return HTML from a HttpHandler via jQuery. I am using the following jQuery javascript to call the handler: $.get('http://localhost:56964/LoadComments.axd?storyID=' + storyID ,function(data) { alert(data); }); The handler performs some processing and returns HTML. The problem I am having is that the above call re...

More than one way to register an ASP.NET Http Handler in web.config?

What is the difference of adding and removing handlers in as oppose to ? In a new web project I made with VS2008, the handlers are defined as this: <system.web> ... <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandle...

HttpHandlers and Forms Authentication

My colleague is using an HttpHandler for compression of javascript and CSS (YUI Compressor for .NET) on an ASP.NET Web Application. He also set up Forms Authentication. The Forms Authentication appears to be blocking the CSS and JavaScript (served by the HttpHandler) from downloading on the login page. Is there a way to exclude this Ht...

Usercontrol events dont fire in Httphandler

uitest.ascx usercontrol events dont fire, does anyone have a clue about it? business.Pages.Page page1 = new business.Pages.Page(); System.Web.UI.HtmlControls.HtmlForm form = new System.Web.UI.HtmlControls.HtmlForm(); UserControl uc = (UserControl)page1.LoadControl("~/use...

HttpHandler not working in IIS 7

I have an HttpHandler configured in my web.config file like so: <add verb="GET,HEAD,POST" path="TinyMCE.ashx" type="Moxiecode.TinyMCE.Web.HttpHandler,Moxiecode.TinyMCE" /> When I deploy to IIS 7 the handler stops working (404). What do I need to do to get this working? ...

Can i invoke ASP.net page handler in console app?

I want to get 20000 HttpRequest or Page.Request instances from console app in less than 10 min. Anyone knows how to do it? I am able to get 20000 instances in a very inefficient way: in the first asp.net page using HTTPWebRequest to call the second asp.net page. Then get the Page.Request of the second page stored in Application object ...