Re: Page context

From: Larry Charlton (LarryCharlton_at_discussions.microsoft.com)
Date: 07/13/04


Date: Tue, 13 Jul 2004 15:51:02 -0700

Currently I do something like the following:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
fk = "" & Request.QueryString("fk")
if fk<>"" Then
  Regen=true
Else
  fk = "" & Request.Form("fk")
end if
if fk="" Then
  fk = New FunctionKey
end if
If Regen
  Get page minus any fk parameters, this is the url that the following will submit to
  Write a page that submits itself back onload="submit();"... that has fk as a hidden field
end if

Does that make sense? Basically I generate an fk if I'm in the page and I don't have an fk. if I have one in the URL I have to rewrite the URL without it, but to work well in a server farm I could only think of putting the fk field on a form. Also the only way I'm going to get to this page with fk on a form is if another page created an auto-submit form that submitted (redirected) to this page. Either way I've got that autosubmit form. Pressing back hits one of these two pages and redirects us back where we currently are. Also if there is a way to prevent those little resubmit pages from hitting the history that would be cool, but seems unsafe...

Basically what I'm hoping for is something like the following. I create a key that points to the status of say a search page. I'd like the search page to "call" the edit page and have the edit page remember that it was called from the search page and the search pages key. When I exit the edit page, if it was called it passes the remembered search key back to the search page and it can blissfully re-render itself with that key.

I'd also like to be able to write a function on one web server that "calls" a function on another web-server and have it be able to return. (because it knows the page that called it and the key that page needs).

While trying to code this I assume that every server request is hitting a different server. (Might be overkill)
"John Saunders" wrote:

> "Larry Charlton" <LarryCharlton@discussions.microsoft.com> wrote in message
> news:72606C90-B314-4091-9C51-5E4665E11F83@microsoft.com...
> > My problem is simpler and harder than that. The "if you ran the search in
> a second window..." is correct. Basically what I want to track is one piece
> of information. A number would work. I have to put that number on the page
> (in the form). When I leave the page for another, that second page needs to
> know what the number is. When it returns to the first page that number
> needs to get passed back so it can get it's context. The number can't be in
> the URL, or if it is, has to be removed immediately.
> >
> > Consider pressing Control+N, I have two different contexts that need to be
> returned to. Something like the following:
> > search(5) -> Control+N -> search(6)
> > Now I have two searches with different contexts and the following might
> happen:
> > search(5) -> Edit(7) -> search(5)
> > search(6) -> Edit(8) -> search(6)
> >
> > What I'm trying to figure out is how to get 5 from search to edit and then
> back again. If I put 5 in the URL, when I press Control+N I get 2 5's.
> >
> > Also consider a web farm. If I use session, I'm going to have to move
> storage off to another server and slow every page down for that server.
>
> Ok. If you need to associate something with a particular browser window,
> then you're pretty much stuck using either the URL or a form field. You may
> use a hidden form field. You can also use Server.Transfer to transfer
> between the search and Edit pages. The Edit page may use the Context.Handler
> property to get access to the members of the search page. This would include
> the saved number.
>
> I could give you more detail and maybe a sample, but I need to know when the
> number is determined, and whether it depends on the search criteria the user
> enters on the search page.
> --
> John Saunders
> johnwsaundersiii at hotmail
>
>
>
> > "John Saunders" wrote:
> >
> > > "Jerry Pisk" <jerryiii@hotmail.com> wrote in message
> > > news:OMjpJIGaEHA.3112@TK2MSFTNGP09.phx.gbl...
> > > > Or not, if you ran another search in a second window on the same
> session.
> > >
> > > If the goal is to keep the "latest search", then this is exactly what
> you
> > > would want.
> > > --
> > > John Saunders
> > > johnwsaundersiii at hotmail
> > >
> > >
> > > > "John Saunders" <johnwsaundersiii@notcoldmail.com> wrote in message
> > > > news:eKs6hb3ZEHA.808@tk2msftngp13.phx.gbl...
> > > > > "Larry Charlton" <LarryCharlton@discussions.microsoft.com> wrote in
> > > > > message
> > > > > news:F1D1C9CB-C332-48E4-B6B0-DC903EDB7761@microsoft.com...
> > > > >> I want to maintain page context between pages.
> > > > >>
> > > > >> Search -> Edit -> back to Search w/last search there and some
> variants
> > > > >>
> > > > >> The thing is I also want people to be able to hit Control+N for a
> new
> > > > > window and get a new search. I'd also like to be able to use the
> foward
> > > > > and
> > > > > backward navigation. So far I've been able to do the following:
> > > > >> I can create a function key, pass it on the URL, pick up the values
> > > from
> > > > > the url, send a form back that auto submits with the URL rewritten
> and
> > > > > context on the form or a variant of this. This has the side effect
> of
> > > no
> > > > > navigation...
> > > > >> or
> > > > >> I can create a function key, pass it on the URL, pick up the values
> > > from
> > > > > the url and use those. This has the side effect of if I hit
> control+N
> > > the
> > > > > new window is using the current windows context. Which can be
> really
> > > bad
> > > > > in
> > > > > some cases...
> > > > >>
> > > > >> Both to work to a point. Is there a .net way to do this? I seem
> to be
> > > a
> > > > > bit thick headed this morning.
> > > > >
> > > > > You can save the search criteria in Session variables. They will
> still
> > > be
> > > > > there when you get back to the Search page.
> > > > > --
> > > > > John Saunders
> > > > > johnwsaundersiii at hotmail
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
>
>
>



Relevant Pages

  • Re: Session variables are lost, disappear from page to page
    ... MS Windows Server 2003 ... says 'edit records' and 'delete records'. ... the data in the session array is gone. ... I think it's a PHP bug, but PHP support won't acknowledge it as a bug, ...
    (comp.lang.php)
  • Re: Session variables are lost, disappear from page to page
    ... MS Windows Server 2003 ... says 'edit records' and 'delete records'. ... the data in the session array is gone. ... I think it's a PHP bug, but PHP support won't acknowledge it as a bug, ...
    (comp.lang.php)
  • Re: Another SQL Server Question
    ... The biggest thing is for the WHERE clause to be executed on the server because ... It is rare for a query to not work at all after moving the tables to ODBC links. ... FROM (LU_Panel INNER JOIN (LU_Crew INNER JOIN (LU_Shift INNER JOIN ... The reference in the SELECT statement to the "Datespan" form field on ...
    (comp.databases.ms-access)
  • Re: Session TimeOut
    ... I am not sure how you can communicate back to the client when session dies ... notification between the client and the server (but then, ... > I display my page in 2 modes: view and edit. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: form confirmation emails are truncated
    ... If the email is truncated after 1 line it is usually because of duplicate or bad form field names ... The server does not need the FP client software installed ... | I have installed on my web server all officeXp updates sp3 included that update had available. ... | frontpage is not installed on the web server only 2002 server extensions ...
    (microsoft.public.frontpage.extensions.windowsnt)