Re: ASP.NET Application - Defined???

From: Steve Taylor (Remove_staylor_at_laborready.com)
Date: 11/01/04


Date: Mon, 1 Nov 2004 14:17:06 -0800

I wish it were that easy! As you can see, I am having trouble just
describing this strange behavior. What started me on this track was wanting
to initialize my session business object at the Defaut.aspx (one-time
gateway to the app). Here's how it works today:
- A user is linked to the Default.aspx from our intranet (classic asp) app
via a hyperlink (using window.open).
- The Global.asax Session_Start creates and stores the user's skeleton
business object into session state (ServerState).
- Then the Default.aspx simply validates where they were coming from (has to
be the intranet url) and transferrs them & their ID to pages/main.aspx.
- Then Main.aspx did the bus obj user validation and filled out the rest of
the object values.

This is all working nicely today, but I want to move the user validation
back to Default.aspx and then update the stored object in session, then
transfer them to Main.aspx. In each form, I instantiate the bus object (on
init) and do the work. The great thing about this is that I can detect when
their session times out (based on null values) on each Form Load event and
handle differently from other errors.

Simply moving the bus obj validation routine back into Default.aspx causes
the object to be missing those values upon getting to the Main.aspx page????
Sure the Default.aspx is in the apps root and Main.aspx is in a sub-folder
(pages), but why would that cause an issue with session state?

Steve

"Kevin Spencer" <kspencer@takempis.com> wrote in message
news:egK6gvFwEHA.3292@TK2MSFTNGP15.phx.gbl...
> It sounds like you're mixing up Session and Application state. Both pages
> ARE in the same application. However, a single Application can contain
many
> Sessions, one per client browser.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
>
> "Steve Taylor" <Remove_staylor@laborready.com> wrote in message
> news:#Yy50hFwEHA.1400@TK2MSFTNGP11.phx.gbl...
> I am having trouble understanding the ASP.NET application boundaries.
> Here's my setup:
>
> 1. Win2003 Server with IIS 6 and an application defined at the root
> "SalesNow" (www.salesnow.com).
>
> 2. A Default.aspx at the root which redirects the user to
"Pages/Main.aspx"
> using javascript window.location.
>
> 3. On the Pages/Main.aspx page a HyperLink control which I add a
javascript
> onclick event which does the
>
> following:
> - NewLeadWin = window.open("NewLeads.aspx", "NewLeadWin", "width=700,
> height=500, location=no, top=20, left=20, menubar=no, status=no,
toolbar=no,
> scrollbars=yes, resizable=yes");
> - NewLeadWin.window.focus();
>
> Scenarios:
> 1. When the Default.aspx contains "window.location =
> '/Salesnow/Pages/Main.aspx'" the NewLeadWin works just fine, yet, the
> session state is not transferred. Trace must be run in both the root and
> /pages to get output.
>
> 2. When the Default.aspx contains "window.location = '/Pages/Main.aspx'"
> the NewLeadWin fails giving the familiar error regarding WEB.CONFIG: It is
> an error to use a section registered as
> allowDefinition='MachineToApplication' beyond application level.
>
> Note: getting to Main.aspx is no problem, but the opening of the
> NewLeads.aspx is.
>
> Question: I thought everything defined within and below the application
> folder (wwwroot in this case) was
>
> considered part of the app. Why is this behavior so?
>
>



Relevant Pages

  • Re: ASP.NET Application - Defined???
    ... > gateway to the app). ... > business object into session state. ... > - Then Main.aspx did the bus obj user validation and filled out the rest ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET Application - Defined???
    ... Session, depending upon the browser. ... > business object into session state. ... > - Then Main.aspx did the bus obj user validation and filled out the rest ... > Sure the Default.aspx is in the apps root and Main.aspx is in a sub-folder ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Losing Session State
    ... > unload then inproc session state is lost. ... > | migrating, before I started withthis company and that file is no longer ... > | set identically to the web.config for this app. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: high scalability possible with heavy use of Session state ?
    ... If you are concerned about session state for an app that large, ... I can only assume you are running in a web farm. ...
    (microsoft.public.dotnet.framework.performance)
  • Re: I keep losing session state on Prod server
    ... > back in the Classic ASP days, reseting our session. ... I built a simple app that uses session variables on my DEV ... >>> and that "Preserve Session State" was checked. ...
    (microsoft.public.dotnet.framework.aspnet)