httphandler

Handler with IRequiresSessionState does not extend session timeout

江枫思渺然 提交于 2019-12-20 05:11:21
问题 I have a handler, like this, using IRequiresSessionState: public class MyHandler : IHttpHandler, IRequiresSessionState { // code } In the code, I am able to read and set Session values. I also check ensure that the caller is logged in. That all works fine. The web site uses forms authentication, so in the web.config, I have this: <authentication mode="Forms"> <forms loginUrl="Login.aspx" timeout="10" slidingExpiration="true"></forms> </authentication> The problem is that AJAX calls from the

Problem with HttpHandler and session state

試著忘記壹切 提交于 2019-12-20 03:31:36
问题 I'm trying to fashion a solution which will simulate App_Offline.htm for remote access but still allow local users to test the website out. I found some various options that I am trying out but the best one doesn't seem to work for our ASP.NET(2.0) site which relies on session state being enabled on all of the pages. The HttpHandler is added into web.config <add verb="*" path="*.aspx" type="AppOffline.AppOfflineHandler, AppOffline" /> and when the class is called, it boils down to this:

How to access localised resources in an .ashx file?

大城市里の小女人 提交于 2019-12-20 02:52:48
问题 I have an ashx file which returns a localised message. This is called from an Ajax request. I need to access the Asp.net ResourceManager in the ashx file. 回答1: Following code worked for me. HttpContext.GetGlobalResourceObject("classKey", "resourceKey") as string; 回答2: Any resources in the app should be accessible under the Resources namespace. For a resource file called LocalMessages.en.resx: ReturnMsg = Resources.LocalMessages.MyAjaxMessage; For intellisense to work, make sure app has been

How do I exclude things that match the specified path for an HttpHandler in ASP.Net?

牧云@^-^@ 提交于 2019-12-20 01:43:47
问题 I know that if I want to have requests for MyPage.aspx go to the class called MyHandler in the assembly called MyAssembly, I can add this to my web.config file: <configuration> <system.web> <httpHandlers> <add verb="*" path="MyPage.aspx" type="MyHandler, MyAssembly"/> </system.web> </configuration> This works for any MyPage.aspx at the (made up) URL: www.mycoolsite.com/MyProject/[SomePathHere]/MyPage.aspx What if I want to do it for every MyPage.aspx except www.mycoolsite.com/MyProject

HttpHandler to hook the *.svc requests

霸气de小男生 提交于 2019-12-19 15:34:24
问题 I'm trying to create a custom ASP.NET HttpHandler to work with any requests to a WCF web services (*.svc) to return a simple predefined SOAP message. However, after added the HttpHandler to the web.config as shown below. It seems that IIS doesn't pick up the handler to execute. But, the same handler seems to be working fine with *.aspx <remove verb="*" path="*.svc"/> <add verb="*" path="*.svc" type="… " /> Does anyone know how to make the HttpHandler to work with the svc extension? or Are

file download popup is not working

自古美人都是妖i 提交于 2019-12-19 11:48:32
问题 I am working on ASP.NET Web form application. My requirement is to show excel file download popupbox when user clicks on the given link (This link is on poppage not on aspx page.). I have a aspx page with link. When user clicks,it will call js function through that we call web service method to generate html for popup screen. CODE : function showListModelFromGenrator(divId) { var lowner = $("#" + hdnLoggedInOwnerID)[0].value; var sowner = $("#" + hdnSelectedOwnnerID)[0].value; var commID = $(

SharePoint - Open Document Library PDF in New Window

强颜欢笑 提交于 2019-12-19 10:28:33
问题 I want PDF files in MOSS 2007 Publishing site document libraries to open in a new window. Is it possible to achieve this by creating a custom HttpHandler? I don't want to mess with a site definition for something as basic as this... 回答1: I also have this requirement and discovered that if you have Adobe Reader installed as part of your SOE and are using this to open your PDFs then the problem is not on the server but the client. Adobe Reader has an option called "Disable display of PDF in

Large File Upload Using HttpHandler or HttpModule?

空扰寡人 提交于 2019-12-18 18:35:49
问题 I have a webform application. It required to be able to upload large file (100MB). I intended to use httpHandler and httpModule to split the file to chunk . I also had a look at http://forums.asp.net/t/55127.aspx But it is a very old post and I've seen some example on the internet using httpHandler. e.g. http://silverlightfileupld.codeplex.com/ I'm not sure httpModule is still better then httpHandler. Since httpModule apples to the request of the whole application, and I just want it apply to

HttpHandler 101 FAIL

心已入冬 提交于 2019-12-18 17:26:44
问题 When I add an HTTP handler: <add verb="*" path="*test.aspx" type="Handler"/> With the class: using System; using System.Web; public class Handler : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.Write("Hello World"); } public bool IsReusable { get { return false; } } } My ASP.NET application dies with the error "Could not load type 'Handler'." when I try to access http://localhost:port/mysite/this-is-a-test.aspx.

HttpHandler 101 FAIL

谁说胖子不能爱 提交于 2019-12-18 17:26:30
问题 When I add an HTTP handler: <add verb="*" path="*test.aspx" type="Handler"/> With the class: using System; using System.Web; public class Handler : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.Write("Hello World"); } public bool IsReusable { get { return false; } } } My ASP.NET application dies with the error "Could not load type 'Handler'." when I try to access http://localhost:port/mysite/this-is-a-test.aspx.