ashx

Multiple image handler calls causing IE to hang in pop-up window

[亡魂溺海] 提交于 2019-12-05 11:23:55
We have an ashx image handler which has performed fairly well over the last few years, but we've recently noticed some odd intermittent behaviour in IE8 and IE9 . We have a gallery page which calls the image handler multiple times as part of an image's src attribute, this page is opened in a pop up window. The page works fine when but when the window is opened and closed in quick succession (before all the images on the page have finished loading) it causes the browser to hang and subsequently has to be restarted. Following is a sample of our image handler code, I have a suspicion that the

asp.net ashx request 404

一笑奈何 提交于 2019-12-05 10:45:02
I am using an ashx request handler to retrieve images and my breakpoint in the ashx file isn't being hit. When I use firebug I can see that the request is returning a 404 which makes me think that I need to configure some setting so that ashx file can be found. I am using visual studio 2008 and .net 3.5. ASHX file namespace hybrid.content.Handlers { public class DB_Images : IHttpHandler { public void ProcessRequest(HttpContext context) { Int32 image_id; if (context.Request.QueryString["id"] != null) image_id = Convert.ToInt32(context.Request.QueryString["id"]); else throw new ArgumentException

How to use web handlers for PDF creation?

情到浓时终转凉″ 提交于 2019-12-05 05:11:16
问题 I have pretty less knowledge in web handlers. All I know is web handlers are used for creating some dynamic file creation purpose. And also I know how to add the Web handlers. But, I need to use web handlers in my ASP.NET project for PDF creation purpose. 回答1: You can have a HTTP handler to serve out your PDFs like this: public void ProcessRequest (HttpContext context) { // Get your file as byte[] string filename = "....file name."; byte[] data = get your PDF file content here; context

Session Not working in Generic Handler .ashx in Firefox

独自空忆成欢 提交于 2019-12-05 03:29:17
问题 I have created .ashx which implemented IRequiresSessionState, so I can create session variables in that ashx, it worked in IE, but doesn't work in Firefox. When access this session variable from other pages it's NULL. any idea? thx. 回答1: Perhaps you don't allow cookies in Firefox. Check that! If you don't want to enable cookies, enable the cookieless session. 回答2: Make cookies enabled in web.config <system.web> <sessionState cookieless="true"></sessionState> </system.web> 来源: https:/

How do you call an ASHX from JavaScript?

走远了吗. 提交于 2019-12-05 02:28:01
问题 I want to call an ASHX file and pass some query string variables from JavaScript and get the return string into a string in the JavaScript. How would I do this? The ASHX file is already coded to response.write a string based on whatever the query strings are. 回答1: Something like this?: function createXMLHttpRequest() { try { return new XMLHttpRequest(); } catch(e) {} try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {} try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch

WCF vs ASPX webmethods vs ASMX webmethods

こ雲淡風輕ζ 提交于 2019-12-04 21:15:45
问题 The intent is to create a set of web services that people can reuse. These services mostly interact with a backend DB creating, retreiving and processing data. We want to expose services so that people can use to create data mashups and other applications. End users are webpages that can be within our domain or outside our domain. For pages outside the domain we plan to release widgets that would be configured to retreive and display the data. One requirement - application should be extremely

how to call ASHX handler and getting the result back

一笑奈何 提交于 2019-12-04 19:57:58
问题 I have created a Handler which return integer value after doing some database work. i would like to know how can i get that value and assign that value to Label by calling that handler. I have googled it and most of the example uses Jquery.AJAX calls to retrieve the value. I am sure i can also get the value by using that. BUT for some limitation in my company i am restricted to use code behind. Any example will help. Handler: http://somesite.com/Stores/GetOrderCount.ashx?sCode=VIC which

ASP.NET VB KML Generator

和自甴很熟 提交于 2019-12-04 16:49:15
Here is a handler (ashx) file that generates KMZ files (can generate KML by not using the Ionic compression classes (Ionic = DotNetZip at Codeplex). This handler uses an SQL table to populate the place marks but is a good example of ashx handler use, custom icon use, properly compressing the file, and populating place marks. By using context.Response.OutputStream, this is very efficient within the .NET engine. <%@ WebHandler Language="VB" Class="YourKML" %> Imports System Imports System.Web Imports System.Web.Configuration Imports System.Xml Imports System.Data Imports System.Data.SqlClient

How to properly use javascript deserialization to convert a json string to a complex object?

自古美人都是妖i 提交于 2019-12-04 14:02:19
I have the following json object that is available in my .ashx handler (var items=): {"Coverages":{"PersonID":10,"DetCode":"","Reimbursement":"","Deductible":"","MaximumPerAnnum":"","MaximumPerVisit":"","MaximumPerVisits":"","SvcCode":""},"CoverageCombinedMaximums":{"PersonID":10,"DetCode":["AAAAA","BBBBB","CCCCC"],"MaximumPerAnnum":""}} public void ProcessRequest (HttpContext context) { bool isSuccessful = true; var items = context.Request.Params["items"]; if (isSuccessful) { JavaScriptSerializer ser = new JavaScriptSerializer(); AdditionalCoveragesPackage package = ser.Deserialize

ASHX handler with ASP.NET MVC 3 and Razor

一笑奈何 提交于 2019-12-04 03:28:32
I would like to use Silverlight Multi File Uploader with ASP.NET MVC 3. The problem is that I need to use ashx handler to handle file upload (the handler is part of the library). How can I integrate the handler with ASP.NET MVC 3 (I'm using Razor view engine) ? Tomas Jansson My guess is that it is easier because it is part of a (older?) third party library and it easier to just follow the instructions that tells you to set something in web.config . You should be able to ignore requests to *.ashx by ignoring routes to *.ashx files. You should be able to use something like this, but I haven't