httphandler

Generic HTTP Handler in ASP.Net

Hello all, I want to write a custom HTTP Handler in ASP.Net (I'm using C# currently) that filters all requests to, say, .aspx files, and then, depending on the page name that comes with the requests, I redirect the user to a page. So far, I've written a handler that filter "*", that is, everything. Let's say I receive a request for "Pa...

ASP.NET HTTPHandler not throwing exception when one is expected

I have an HttpHandler class (implements IHttphandler) where the path defined for the handler in web.config is *.jpg. I am requesting a Jpg image in my page. Within the HTTP Handler I am writing to a file in the filesystem. By mistake I was trying to write to a non existant directory. This should have thrown an exception but the execution...

ASP.Net HttpHandler ProcessRequest() firing twice

Hi there, I have a strange issue where i have a a HttpHandler having its ProcessRequest() event firing twice. i have nothing else in the class except a pointer to a static method so i'm lost. I have done some googling to no avail even thought it appears a few people are having similar issues: Code: public bool IsReusable { ...

How can I stream .flv files in IIS7

I have a working solution on an IIS6, which I made using this guide: FLV Flash video streaming with ASP.NET 2.0, IIS and HTTP handler The app is basically a FLV Player, but streaming is essential to it. Now, one of our customers is running IIS7 and the streaming doesn't work, so I was hoping that someone in here would now how do handle...

Reoccurring timer in Asp.net

Hi, I am trying to implement a reoccurring timer function asp.net. I am not able to create a windows service as I host the site on a shared environment and therefore do not have access. I have read various ways of achieving this each with their own advantages/disadvantages. The cache object approach seemed promising but does seem like ...

ASHX handler; fires up only once...

I've got a simple ASHX handler that returns an dynamically generated image; the image is generated from a custom created class, and an object belonging to this class is passed to the handler using Session (I'd rather avoid using QueryString). The handler is used as the URL of an image on a ASP form which is very simple: a drop down list...

ReportViewer 9.0 on IIS 7 not rendering

Hello, I have a reportviewer control that works fine locally and on a iis 6.0 box, but when deployed to the IIS 7 webserver, the control has broken images. The report does return data but the top bar has broken images and buttons. Using Fiddler I see that the images requests are returning a 404 or 500 error. I got the 500 after cha...

Why my HttpHandler is ignored?

Hi, In an ASP.NET application, I need to do some changes on every CSS file sent. So I created an HttpHandler (inside the app itself), added: <add verb="*" path="*.css" type="MyWebsite.CssTestHandler,MyWebsite"/> to Web.config in system.web/httpHandlers and modified the handler like this: public void ProcessRequest(HttpContext conte...

ASP.Net 4.0 - How to access RouteData from within an ASHX?

My web site has a handler (FileDownload.ashx) that deals with all file download requests. I've recently migrated my site to ASP.Net 4.0, and it now uses routing extensively. Everything works fine when dealing with page requests (aspx), but it's not working with my handler - I encounter the following error: Type '<snip>.Handlers.FileDown...

Regular Expression on web.config location path attribute (with parameters)

Is there any way of doing something like this? <location path="/(view|edit)post.aspx\?id=[7-9][0-9]+"> <system.web> <authorization> <allow roles="AdminPublishers"/> <deny users="*"/> </authorization> </system.web> </location> Authorization is just an example. I would like to be able to do other thin...

How to secure my generic handler calls?

I am creating a myspace application and for some database entries I am using generic handlers which I have hosted on another website. From my myspace application I use ajax calls to those handlers to perform the activities that I want. I want to know how can I make these ajax calls secure? I mean I want to be sure that the handlers are b...

jQuery POST. Can't get Request parameters using custom httphandler

I have a jQuery post method with JSON data included. In my httphandler, in the processRequest method, Request["Operation"] is null and none of my data is posted. I am in a SharePoint 2010 environment. public void ProcessRequest(HttpContext context) { try { string operation = context.Request["Operation"]...

Modifying Web.Config handlers section generates extra unneeded entries

I've written a command line tool that deploys HTTP Handlers to an applications Web.Config file using a combination of System.Configuration, System.Web.Configuration and Microsoft.Web.Administration since it needs to register the handlers for both Classic and Integrated Modes as I don't know what mode end users will be using for their IIS...

AntiForgery implementation in Asp.net Forms

I am developing an httphandler to process some requests in Web Forms (NOT in MVC). How could I implement Anti Cross Site Scripting (like antiforgery in MVC)? I want to know mre about the antiforgery mechanism in MVC. ...

HTTPHandler : IRequiresSessionState halts execution of pages

I have ASHX HTTPHandler which implements IRequiresSessionState. When I call this handler, and call aspx page of same application in another window, aspx page does not start processing until ashx page finishes processing. Even call to same ashx page from two different windows show that page which gets called first executes and then the ne...

How to pass user authentication when visiting another url?

Suppose I have a web app MyApp. When I access this web app, I have input user authentication info( user name and password), then from this site, want to visit another site say YourSite which will ask authentication too. Same authentication should be fine for both site. So I want to pass user authentication data on MyApp to YourSite in ...

Application_BeginRequest called for images

I've seen a few posts about Application_BeginRequest, but non seems to have my problem. My Application_BeginRequest is being called for every image in my website. The StaticFile Handler is enabled with * as the Path, but it's at the end of the list. Is this the normal behaviour? Or should I add .gif, .jpg and so on on top of the list...

Can I limit an ASP.net HttpHandler scope?

I have an application that depends on a generic HttpHandler I created, and it works fine. The problem is that that there are many other applications under the same folder in IIS, and these other apps don't need to use and don't know (mustn't know) about this handler. However, the Web.Config in which I register it ends up applying to all ...

HttpHandlers for .css files not working for classic asp pages

I have written a HttpHandler to modify the css file (image urls that are reffered in the css files). This works fine for the .aspx pages. But classic asp pages are broken as the css is not at all loaded. I have added the .css mapping in the configuration section of the IIS and mapped it into aspnet_isapi.dll. ...

Unable to set up WebDAV with IIS 7

Two symptoms... First, here's the situation: I'm running IIS 7 on a Windows 7 box. I'm trying to set up WebDAV but am running into problems. I followed the directions in this article to set things up in IIS: http://learn.iis.net/page.aspx/350/installing-and-configuring-webdav-on-iis-7/ I have a .NET project at http://localhost/ithitw...