473,287 Members | 2,682 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

HttpHandlers and Session access

Hi group, I read a lot about this problem and all the same answers
appears...Implement the IRequireSessionState or IReadOnlySessionState
interface...but the same problem arrays'...null session.

Anyone have a solution for this problem?. I'm on the GetHandler methods
inside my custom Hander!. Please group, people...and Good I' Ned your
help :P

Regards and Thanks!

May 16 '06 #1
3 1533
I use System.Web.SessionState.IRequiresSessionState and it works, no
implementation necessary.

SA

<da******************@gmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
Hi group, I read a lot about this problem and all the same answers
appears...Implement the IRequireSessionState or IReadOnlySessionState
interface...but the same problem arrays'...null session.

Anyone have a solution for this problem?. I'm on the GetHandler methods
inside my custom Hander!. Please group, people...and Good I' Ned your
help :P

Regards and Thanks!

May 16 '06 #2
Tanks for your reply, can you send me an example code?. Maybe I'm doing
something wrong.

This is my actual no working code :(

internal class CustomHandler: IHttpHandlerFactory,
IRequiresSessionState
{
public CustomHandler()
{

}

#region IHttpHandlerFactory Members

public void ReleaseHandler(IHttpHandler handler)
{

}

public IHttpHandler GetHandler(HttpContext context, string requestType,
string url, string pathTranslated)
{
Page compiledPage;

compiledPage =
PageParser.GetCompiledPageInstance(url,pathTransla ted, context) as
Page;

HttpContext.Current.Session["myId"] --> null. The entired
Session object is null

--------------------------------------------------------------------------------------

Thanks!

Damian.

May 18 '06 #3
I only implement IHttpHandler and not IHttpHandlerFactory

then I use

HttpContext.Current.Session.Add("imgVal", imgVal)

This is in VB...

Public Class imageservice
Implements IHttpHandler
Implements System.Web.SessionState.IRequiresSessionState

Public Overridable ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return True
End Get
End Property
Public Overridable Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim oPic As Byte()
Dim imgVal As String
Try
.....
HttpContext.Current.Session.Add("imgVal", imgVal)
HttpContext.Current.Response.ContentType = "image/jpeg"
HttpContext.Current.Response.OutputStream.Write(.. .., 0, oPic.Length)
Catch ex As Exception
ExceptionManager.Publish(ex)
Throw ex
End Try
End Sub
..... any other private Subs here

Hope that helps

SA



<da******************@gmail.com> wrote in message news:11**********************@g10g2000cwb.googlegr oups.com...
Tanks for your reply, can you send me an example code?. Maybe I'm doing
something wrong.

This is my actual no working code :(

internal class CustomHandler: IHttpHandlerFactory,
IRequiresSessionState
{
public CustomHandler()
{

}

#region IHttpHandlerFactory Members

public void ReleaseHandler(IHttpHandler handler)
{

}

public IHttpHandler GetHandler(HttpContext context, string requestType,
string url, string pathTranslated)
{
Page compiledPage;

compiledPage =
PageParser.GetCompiledPageInstance(url,pathTransla ted, context) as
Page;

HttpContext.Current.Session["myId"] --> null. The entired
Session object is null

--------------------------------------------------------------------------------------

Thanks!

Damian.

May 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: some guy with a computer | last post by:
I can not get a custom httpHandler to fire using machine.config and an assembly in the GAC. It will not work if I move the assembly to the GAC, even though I have it referenced correctly and add...
0
by: Chance Hopkins | last post by:
Does anyone know how to get a custom httpHandler to fire for all applications in machine.config for an assembly in the GAC, without using seperate location tags? For instance, this works for a...
1
by: Patrick Kristiansen | last post by:
Hi! I have on my website a root web.config file, and also created a subapplication "/publikationer". In my root web.config I've specified an HTTP-handler for some requests, but this is mirrored...
2
by: Prince | last post by:
I have the following code within the ASP.NET project I have created. public class RedirectHandler : IHttpHandler{ //empty constructor public void ProcessRequest(HttpContext context){...
4
by: Grant Harmeyer | last post by:
How would I set up an httpHandler so that it would only apply to certain child directories of the application? I.E: <httpHandlers> <add verb="*" path="/files/*/*/*/*.aspx"...
3
by: MWells | last post by:
I'm having an issue getting my HttpHandlers and HttpModules to play together nicely. My HttpHandlers take special document types (defined by extension) and process them specially. I might have...
4
by: Jan Kucera | last post by:
Hi, I do that for the first time, but posting this in microsoft.public.dotnet.framework.aspnet, microsoft.public.inetserver.iis, http://forums.asp.net/thread/1271188.aspx (no response) and...
5
by: Anonieko | last post by:
HttpHandlers - Learn Them. Use Them. Introduction There are many features in ASP.NET that are unfortunately underused. Sometimes a feature gets looked over because it's too complicated....
2
by: Fernando Rodriguez | last post by:
I created an HttpHandler for rewritting URLs. It simply checks if the requested page is on a list of "special" pages (that do not exist) and if it is on the list then it will transfer to an ASPX...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.