473,403 Members | 2,222 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,403 software developers and data experts.

HttpHandler: context.Request.UrlReferrer data is null

Hi,

I have implemented the IHttpHandler interface for generating images and
writing them to response stream in binary format. I use an
IHttpHandlerFactory to instantiate that handler. A .aspx page sends a
request to the factory which then instantiates an instance of the
handler. The response is read by a third party component that then
displays the image.

i.e. inside .aspx page:
-------------------------
3rdPartyComp.ImageURL =
"http:\\localhost\ImageGenerator\image.imgr?x=100& y=200";

(.imgr extension is registered with IIS and is declared in web.config
httphandler section)

While debugging this handler, I came across a weird situation where the
context parameter that gets passed in ProcesRequest module has null
value for the context.Request.UrlReferrer parameter. Other stuff like
querystring, sessionstate (implemented IRequiresSessionState in
handler) etc. do exist though. Needless to say..the HttpInputStream is
empty when I tried to view its contents.

I used 'Fiddler' to track requests sent to the handler but that did not
help much.

Would appreciate if anyone who faced the same issue could help me
identify the missing link.

Thanks

Jul 3 '06 #1
2 6782
<de*************@gmail.comwrote in message
news:11**********************@v61g2000cwv.googlegr oups.com...
Hi,

I have implemented the IHttpHandler interface for generating images and
writing them to response stream in binary format. I use an
IHttpHandlerFactory to instantiate that handler. A .aspx page sends a
request to the factory which then instantiates an instance of the
handler. The response is read by a third party component that then
displays the image.

i.e. inside .aspx page:
-------------------------
3rdPartyComp.ImageURL =
"http:\\localhost\ImageGenerator\image.imgr?x=100& y=200";

(.imgr extension is registered with IIS and is declared in web.config
httphandler section)

While debugging this handler, I came across a weird situation where the
context parameter that gets passed in ProcesRequest module has null
value for the context.Request.UrlReferrer parameter. Other stuff like
querystring, sessionstate (implemented IRequiresSessionState in
handler) etc. do exist though. Needless to say..the HttpInputStream is
empty when I tried to view its contents.

I used 'Fiddler' to track requests sent to the handler but that did not
help much.

Would appreciate if anyone who faced the same issue could help me
identify the missing link.
There may not be a missing link. The UrlReferrer comes from an Http header.
If the header is not provided, then UrlReferrer will be null.

This is an expected situation.

John
Jul 7 '06 #2
Thanks for replying John. Regarding header info, 'Fiddler' showed me that a
header is being sent but does not have all info. ASP.NET tracing reconfirmed
this behavior.

However, I recently discovered that if I have an image tag whose src
attribute is set to the image httphandler, everything works fine and context
is not null. It still doesn't work otherwise. So I am still stuck :(

Thanks

"John Saunders" wrote:
<de*************@gmail.comwrote in message
news:11**********************@v61g2000cwv.googlegr oups.com...
Hi,

I have implemented the IHttpHandler interface for generating images and
writing them to response stream in binary format. I use an
IHttpHandlerFactory to instantiate that handler. A .aspx page sends a
request to the factory which then instantiates an instance of the
handler. The response is read by a third party component that then
displays the image.

i.e. inside .aspx page:
-------------------------
3rdPartyComp.ImageURL =
"http:\\localhost\ImageGenerator\image.imgr?x=100& y=200";

(.imgr extension is registered with IIS and is declared in web.config
httphandler section)

While debugging this handler, I came across a weird situation where the
context parameter that gets passed in ProcesRequest module has null
value for the context.Request.UrlReferrer parameter. Other stuff like
querystring, sessionstate (implemented IRequiresSessionState in
handler) etc. do exist though. Needless to say..the HttpInputStream is
empty when I tried to view its contents.

I used 'Fiddler' to track requests sent to the handler but that did not
help much.

Would appreciate if anyone who faced the same issue could help me
identify the missing link.

There may not be a missing link. The UrlReferrer comes from an Http header.
If the header is not provided, then UrlReferrer will be null.

This is an expected situation.

John
Jul 8 '06 #3

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

Similar topics

0
by: Jiong Feng | last post by:
Hi, Here is my problem: I created a try.htm on my server, which contains a link to the default.aspx page. if I use http://localhost/try.htm, and click the link, then in default.aspx, I could...
4
by: Harley | last post by:
i have found a problem when using Request.UrlReferrer. if i call the page using a javascript function, the referrer is null... i need to call a page and open it on a specific browser size, with no...
7
by: Ivan Demkovitch | last post by:
Hi! Here is what I'm doing: I have Login.aspx with code to do forms authentification and I have this line at the end: Response.Redirect(Request.UrlReferrer.ToString()); I have other...
3
by: Oney | last post by:
I created two iss folder under my aspx project and I redirected each one of them to same aspx page by IIS that is test.aspx. on the page load of test.aspx I have to catch where the request come in!...
7
by: Aaron Prohaska | last post by:
Has anyone had any experience with Nortan Antivirus causing problems when trying to use Request.UrlReferrer? I am seeing in the Nortan Antivirus log that its blocking my page from loading because...
6
by: saden_paki | last post by:
I am having this problem, that Request.UrlReferrer comes out to be Nothing, when a user hits a button on a html page which only have this button, on this button's onClick javascript event I have...
2
by: ad | last post by:
I have tree web page A.ASPX, B.ASPX and CheckPW.aspx There is a button in A.ASPX, the click of that button is redirect to B.ASPX .. I write a Page_Load event in b.aspx, if the Session is null...
0
by: superman | last post by:
Hi, I have implemented the IHttpHandler interface for generating images and writing them to response stream in binary format. I use an IHttpHandlerFactory to instantiate that handler. A .aspx...
0
AmirGhaffary
by: AmirGhaffary | last post by:
want to insert user Url into data base I work with ASP.NET and i used this code in Session_Start at Global.asax Dim Ref As String If Not Request.UrlReferrer Is Nothing Then ...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.