Questions tagged [generic-handler]

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.

161 questions
0
votes
1 answer

Create session oriented API's in asp.net Framework 4.0

I am working on a project where mobile apps connects to website through a set of API's. I considered creating API's using "Generic Handlers". This was seems to be working fine until restriction are defined for sensitive data. User has to be…
Basavaraj Metri
  • 836
  • 1
  • 14
  • 27
0
votes
1 answer

Upload file asynchronously using generic handler

I've used the code bellow to upload a file to server asynchronously: HTML:
Muhamad Jafarnejad
  • 2,521
  • 4
  • 21
  • 34
0
votes
2 answers

Asychronous Task works with HttpClient object but not with project's class in Web Generic Handler

I found an interesting differences between .NET Framework's HttpClient class/objects and the VS-2013 Project PhotoServer (DLL) class/objects. It made me wonder if there's a bug with the script. I'm using .NET Framework v4.5.1. I'm using the…
fletchsod
  • 3,560
  • 7
  • 39
  • 65
0
votes
1 answer

How to pass parameter from generic Handler file to aspx page

I want to show a specific persons identity on an aspx page on page load (data includes photo, name, .. etc) On aspx page loading, handler file runs in backhand i fetch data from database, inside this handler file. i used handler, for to convert…
perlynsparks
  • 401
  • 3
  • 7
  • 20
0
votes
1 answer

How to pass image to Eval method from handler.ashx to imageurl?

I want to retrieve image from database and display in an aspx page. I use Linq to SQL. And a Generic handler. Handler2.ashx code: public void ProcessRequest(HttpContext context) { if (context.Request.QueryString["id"] != null) { int…
perlynsparks
  • 401
  • 3
  • 7
  • 20
0
votes
1 answer

Why am i not able to place Generic Handler file as a root file?

The problem i am facing is that whenever i add new item and choose Generic Handler file.The "place code in separate file" option is disabled as a result the handler file appears inside other files. I am using visual studio 10. So when i see the…
user35
  • 468
  • 1
  • 9
  • 24
0
votes
0 answers

Use STAThread in c# Generic Handler

This is the error I'm getting: ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment. I have placed the [STAThread] before the ProcessRequest method, but it…
pithhelmet
  • 2,222
  • 6
  • 35
  • 60
0
votes
1 answer

How do I return a byte array from the db as a compressed jpeg/png?

Here's my situation: I have a console application that creates screenshots of webpages in a bitmap format and then saves it to a database as a byte array. Then I have a Generic Handler that basically gets the byte array and then returns the image…
0
votes
0 answers

Generic Handler and SQL Server connection

I have this code in Generic Handler to connect to database and retrieve the image from table, But when user logging on will choose the database, for example: my database is: SH001 user: username Password: password I save the database in…
Yaser
  • 87
  • 2
  • 9
0
votes
0 answers

Get session data in a generic handler mvc

While I am trying to retrieve session value from a generic handler, it throws "object reference not set to an object. Here is my code- public class Upload : IHttpHandler { public void ProcessRequest(HttpContext context) { Int32…
s.k.paul
  • 7,099
  • 28
  • 93
  • 168
0
votes
1 answer

How to bind generic handler to Label.Text in ASP.NET

I am trying to bind output of generic handler to Label. Make it simple. My handler only write the "Hello World" string. public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; …
user2095405
  • 347
  • 1
  • 4
  • 15
0
votes
1 answer

Filter file type to upload in ASP.Net Generic Handlers

I would like to upload some files with jQuery File Upload, but i want to filter file types by this code: public class file : IHttpHandler { public void ProcessRequest(HttpContext context) { HttpPostedFile postedFile =…
Rasool Ghafari
  • 4,128
  • 7
  • 44
  • 71
0
votes
0 answers

html5 server sent events EventSource not recognized

I am trying to create a demo project with HTML5 server sent events, I have created a generic handler that will generate data (random numbers) to be sent to the client side. I have also created a webform (.aspx) page to be the client. I wrote…
AC25
  • 413
  • 1
  • 7
  • 23
0
votes
1 answer

Read XML file using Linq to XML inside a generic Handler C#

I have a generic handler that will read an XML file, and send the result to the ajax call as JSON. When I run the program i get this error: Client Side Code: $(function () { $('#getData').click(function () { $.ajax({ type: 'GET', …
OmerBTW
  • 780
  • 7
  • 11
0
votes
1 answer

IHttp Generic Handler (.ashx) for Images cache validator

I have IHttp Generic Handler (.ashx) for images and I have sent cache expire time as 7 days but in Google page insight it says I should add cache validator. following is my code. Please refer me something. public void ProcessRequest(HttpContext…