Re: HTTP_REFERER not always there

Tech-Archive recommends: Speed Up your PC by fixing your registry



If you have only 5 pages where you need to keep track of that it looks like
not that cumbersome. Another option is to put this in some general place
that is always executed (perhaps beginrequest if you don't have such a
general place for now).

--
Patrice

"tshad" <tscheiderich@xxxxxxxxxxxxxxx> a écrit dans le message de
news:uNJEeOO0FHA.3000@xxxxxxxxxxxxxxxxxxxxxxx
> "Patrice" <nobody@xxxxxxxxxxx> wrote in message
> news:Ob9x0WJ0FHA.2792@xxxxxxxxxxxxxxxxxxxxxxx
> > This could be not available (this is optional and some browser my block
> > this
> > for privacy purpose) plus it won't be there if the the user have the
page
> > in
> > its favorites...
> >
> > You could keep track of the previous page in the session variable as you
> > seems to do...
>
> But the problem with that is I would need to put that in all my pages.
>
> Mainly, I have a few pages that are connected, such as an Application may
> take 5 pages to finish and I want to make sure that the use doesn't go
> directly to page 3 from a Browser entry. I want them to go to Page 1
first
> and push the next button (or previous button after the first page) to
> navigate the pages. To do this I need to know that page 3 got there from
> either page 2 or page 4. The referer would be the logical place to look,
> but if some browsers are preventing that, then I can't very well use that.
>
> It really makes that ServerVariable virtually useless. If you can't
depend
> on it, how can you use it.
>
> Tom
> >
> > --
> > Patrice
> >
> > "tshad" <tfs@xxxxxxxxxxxxxx> a écrit dans le message de
> > news:%23$Yd7rI0FHA.2212@xxxxxxxxxxxxxxxxxxxxxxx
> >> Why would HTTP_REFERER not be there in the Page_Load event?
> >>
> >> I am using it to determine whether a page was called from a particular
> > page.
> >>
> >> I am doing:
> >>
> >> sTest = Request.ServerVariables("HTTP_REFERER")
> >> if (sTest = "") ORELSE (sTest.SubString(sTest.LastIndexOf("/")+1)
> >> <>
> >> "job_posting_new2.aspx") then
> >> newPosition = new Position
> >> session.Remove("newPosition")
> >> else
> >> newPosition = session("newPosition")
> >> end if
> >>
> >> I was originally doing:
> >>
> >> if (sTest.SubString(sTest.LastIndexOf("/")+1)
> >>
> >> But if HTTP_REFERER wasn't there, I would get an error:
> >>
> >> Object reference not set to an instance of an object.
> >>
> >> Not sure why.
> >>
> >> Thanks,
> >>
> >> Tom
> >>
> >>
> >
> >
>
>


.


Quantcast