generic-handler

Uploading images with asp.net generic handler

时光总嘲笑我的痴心妄想 提交于 2019-12-11 00:47:49
问题 I am trying to upload multiple files using the following code. HTML & JQuery <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="FileUpload.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="Scripts/jquery-1.8.2.min.js"></script> <script src="Scripts/jquery-ui-1.8.24.min.js"></script> <link href="Content/themes/base/jquery.ui.all.css" rel="stylesheet" /> </head> <body> <form id="form1"

Session saved in handler cannot be accessed in aspx file

随声附和 提交于 2019-12-08 09:24:04
问题 I am implementing captcha on the first page of my web application ie. on the login page. The captcha value is set in the generic handler which needs to be accessed in login.aspx page for verification. The captcha was working perfectly fine until I added a code to reset session ID every time user comes to the login page. I have this in my page load even of login.aspx: private void Page_Load(object sender, System.EventArgs e) { if(!IsPostBack) { Session.Abandon(); Response.Cookies.Add(new

ASP.NET Generic Handler not getting called after .NET 3.5 to .NET 4.0 upgrade

≯℡__Kan透↙ 提交于 2019-12-07 21:19:00
问题 This old title describes the visible issue, but the new title describes the root cause issue a little better. I'm still not sure why the ASHX isn't getting called, so I'm still looking for an answer. I have a workaround for now by hard coding the API descriptor (Ext.app.REMOTING_API variable). I got that JSON object (Ext.app.REMOTING_API variable) from the DirectProxy "provider" returned variable, from the original code running .NET 3.5. I just used an online JavaScript beautifier to make it

ASP.NET Generic Handler not getting called after .NET 3.5 to .NET 4.0 upgrade

拥有回忆 提交于 2019-12-06 13:04:26
This old title describes the visible issue, but the new title describes the root cause issue a little better. I'm still not sure why the ASHX isn't getting called, so I'm still looking for an answer. I have a workaround for now by hard coding the API descriptor (Ext.app.REMOTING_API variable). I got that JSON object (Ext.app.REMOTING_API variable) from the DirectProxy "provider" returned variable, from the original code running .NET 3.5. I just used an online JavaScript beautifier to make it look beautiful (so you can read it, instead of being on a single line). Old Title: ExtJS 3 Ext.Direct

How do I inject into some generic asp.net http handler using Ninject?

╄→гoц情女王★ 提交于 2019-12-05 05:10:13
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 registering services: private static void RegisterServices(IKernel kernel) { kernel.Bind<NLSubscriber.Core.Service.Repository.INLUserRepository>().To<NLSubscriber.Core.Service.Repository.EFDAL.EFNLUserRepository>().InRequestScope(); kernel.Bind<Neticon.Mvc.Helpers.IConfigHelper>().To<Neticon.Mvc.Helpers.AzureEnabledConfigHelper>().InSingletonScope(); kernel

Troubleshooting jQuery AJAX call using Generic Handler in ASP.NET

≯℡__Kan透↙ 提交于 2019-11-30 23:22:33
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 the code behind of my generic handler ProcessRequest method, it doesn't stop there. So it's not even reaching the handler. Why would that be? It's also only executing the error function every other click on my search button (BtnUCSSearch). And I don't have an option to press okay on the Error popup like a typical JavaScript alert. It flickers and

Troubleshooting jQuery AJAX call using Generic Handler in ASP.NET

二次信任 提交于 2019-11-30 18:11:20
问题 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 the code behind of my generic handler ProcessRequest method, it doesn't stop there. So it's not even reaching the handler. Why would that be? It's also only executing the error function every other click on my search button (BtnUCSSearch). And I don

File Upload with jQuery AJAX and Handler (ashx) not working

白昼怎懂夜的黑 提交于 2019-11-30 10:15:11
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: <form id="form1" runat="server" method="post" enctype="multipart/form-data"> <input name="file" id="file" type="file" /> <input id="save" name="submit" value="Submit" type="submit" /> </form> JS: $().ready(function () { $('#file').change(function () { sendFile(this.files[0]); }); }); function sendFile(file) { $.ajax({ type: 'post', url: 'FileUpload.ashx', data: file,

ASP.NET Generic Handlers & Session

与世无争的帅哥 提交于 2019-11-27 14:47:49
问题 I have an issue with GenericHandler and anonymousIdentification. Basically if <anonymousIdentification enabled="true" /> 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 and a new user session. Is there a way to mitigate this? I need to access the current user's session variables... It is really frustrating! 回答1: Generic handlers must implement the IReadOnlySessionState interface to access session variables. If

HttpContext.Current.Session is null in Ashx file

拟墨画扇 提交于 2019-11-27 00:50:57
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 = HttpContext.Current.Session // This is null Or: public virtual void ProcessRequest(HttpContext context) { System.Web.SessionState.HttpSessionState Session = context.Session; // This is null } In the Web.config: <sessionState timeout="1800"></sessionState> You must add on your handler the IRequiresSessionState on the declaration of it as: public class