Generic handlers are the .NET components that implement the System.Web.IHttpHandler interface. Any class that implements the IHttpHandler interface can act as a target for the incoming HTTP requests.
Questions tagged [generic-handler]
161 questions
45
votes
1 answer
HttpContext.Current.Session is null in Ashx file
I saw some questions (Here and Here) but they do not answer my question.
I am trying to call Ajax using "ajax.ashx" file, and in function to access Session.
For some reason, the value of the Session object itself is null.
Use example:
Session =…

Mosh Feu
- 28,354
- 16
- 88
- 135
19
votes
4 answers
ASP.NET Generic Handlers & Session
I have an issue with GenericHandler and anonymousIdentification.
Basically if is turned on in the web config, whenever a JQuery GET/POST request is sent to the server, that request executes under a new user…

bleepzter
- 9,607
- 11
- 41
- 64
8
votes
1 answer
Pass fancytree data as JSON data
I want to pass the data from a fancytree to a generic handler so that I can save it for future use.
If I use this code:
function SaveTree() {
var tree = $('#TopTree').fancytree("getTree");
$.ajax({
cache: false,
url:…

Family
- 1,053
- 1
- 20
- 41
7
votes
3 answers
How do I inject into some generic asp.net http handler using Ninject?
I'm a newbie using Ninject and I can't figure out how to inject into my generic http handler. I have a MVC3 project and I'm injecting my services into controllers with no problem at all.
This is what I got in my Ninject App_start class for…

Cristian Grisolia
- 157
- 1
- 7
6
votes
1 answer
Redirect from successful stripe checkout
I am using Stripes payment gateway with C# .Net. I started with creating a checkout which redirects the user to Stripe's payment gateway (I didnt want the hassle of maintaining the card numbers etc so this way it forwards to Stripe to ask for the…

Computer
- 2,149
- 7
- 34
- 71
5
votes
4 answers
Could allocating a byte array be performance-critical?
In my small little file transfer website (this one, running .NET 4.5.1) I'm following the Microsoft Knowledge Base article 812406 to send previously uploaded files from the server to the browser.
Doing performance optimization I was suprised to find…

Uwe Keim
- 39,551
- 56
- 175
- 291
4
votes
1 answer
Asp.Net Routing to a generic handler
I Have a generic handler that's serving member logo images:
http://site.com/logo.ashx?memberid=123
Now, I want to use it by caling a url like:
http://site.com/logo/john.jpg
So I would create a route for that (pattern: "logo/{username}.jpg"). But,…

Andrey
- 20,487
- 26
- 108
- 176
4
votes
1 answer
Restrict API URL only to Android Application
I have created an Android application with C# on the server side. Following this tutorial, I am using Json web service. Everything is working well, but the only issue is if someone hits www.mydomain.com/Handler.ashx?ANDROID, then all the methods…

Alok Gupta
- 1,353
- 1
- 13
- 29
4
votes
0 answers
How to set HttpResponse StatusDescription in a content handler?
I am trying to set a custom HTTP status header in an HTTP response. E.g.:
400 Why do you want to do that
I am doing this by setting the StatusDescription of an HttpResponse in an IHttpHandler, in
<%@ WebHandler Language="C#" Class="Foo" %>
using…

Ian Boyd
- 246,734
- 253
- 869
- 1,219
4
votes
2 answers
File Upload with jQuery AJAX and Handler (ashx) not working
I'm trying to upload an image file with jQuery AJAX and a generic handler. But it seems that the file isn't being passed to the handler.
After submit context.Request.Files[0]; is always null :-/
What am i doing wrong?
HTML:
3
votes
3 answers
Troubleshooting jQuery AJAX call using Generic Handler in ASP.NET
What is the best method to troubleshooting a jQuery AJAX call with ASP.NET? The error function is getting called--I get the alert to popup that says "Error", but I don't know why. When I attach to my process (w3wp.exe), and place a breakpoint into…

JustBeingHelpful
- 18,332
- 38
- 160
- 245
3
votes
3 answers
Hooking up generic event handlers to multiple controls of the same type
I have a WinForms app that contains many NumericUpDown controls. In a nutshell, if my users enter a value into the control and then delete the text, I want to restore it (the text) when the control loses focus. So I decided that I'd check .Text…

bmt22033
- 6,880
- 14
- 69
- 98
3
votes
2 answers
How To Return Data type JSON in ashx
I'm looking for a way to export the data into a JSON style. Please show me the way
<%@ WebHandler Language="C#" Class="API" %>
using System;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using…

Please Help Me
- 53
- 1
- 9
3
votes
3 answers
"Potentially Dangerous Request.Form" Exception in a generic handler
I've seen this error before but cannot seem to get around it. In this case, I have an ASHX page spitting out a simple HTML form with a textbox into which XML may be posted. When I try to read the form, I receive the "A potentially dangerous…

roufamatic
- 18,187
- 7
- 57
- 86