473,385 Members | 2,015 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,385 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 1535
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.