By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 849 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

ASP.NET Application - Defined???

P: n/a
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?

Nov 18 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
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" <Re************@laborready.com> wrote in message
news:#Y**************@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?
Nov 18 '05 #2

P: n/a
The error you are getting when accessing the Pages folder is because you included a web.config file in that folder that conatins application level definitions (forms authentication settings for example).
Everything defined within and below the application folder (wwwroot in this case) is considered part of the app but definitions such as the ones you put on the web.config in Pages require it to be a seperate ASP.NET application...
To solve the problem you need to define the Pages folder as an application in the IIS properties dialog.

Eran Kampf
http://www.ekampf.com

"Steve Taylor" <Re************@laborready.com> wrote in message news:%2****************@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?

Nov 18 '05 #3

P: n/a
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" <ks******@takempis.com> wrote in message
news:eg**************@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" <Re************@laborready.com> wrote in message
news:#Y**************@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?

Nov 18 '05 #4

P: n/a
No, there is no other web.config file. Just the one at the root.
"Eran Kampf" <er**@ekampf.com> wrote in message news:O6**************@TK2MSFTNGP12.phx.gbl...
The error you are getting when accessing the Pages folder is because you included a web.config file in that folder that conatins application level definitions (forms authentication settings for example).
Everything defined within and below the application folder (wwwroot in this case) is considered part of the app but definitions such as the ones you put on the web.config in Pages require it to be a seperate ASP.NET application...
To solve the problem you need to define the Pages folder as an application in the IIS properties dialog.

Eran Kampf
http://www.ekampf.com

"Steve Taylor" <Re************@laborready.com> wrote in message news:%2****************@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?

Nov 18 '05 #5

P: n/a
Hi Steve,

Are these multiple apps? In your /Pages folder do you have a Bin directory?
Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Steve Taylor" <Re************@laborready.com> wrote in message
news:OT*************@TK2MSFTNGP11.phx.gbl...
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" <ks******@takempis.com> wrote in message
news:eg**************@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" <Re************@laborready.com> wrote in message
news:#Y**************@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?


Nov 18 '05 #6

P: n/a
Hi Steve,

I'm somewhat confused, but I'll take a crack at helping as much as I can.

A web application is defined as a virtual root directory (a directory which
is configured in IIS as an Application), and all of the directories
underneath it which are NOT defined as applications. It sounds like your IIS
Application configuration is messed up. I would start by taking a look at
that.

Opening a browser window using JavaScript may or may not initiate a new
Session, depending upon the browser. I wouldn't count on it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Steve Taylor" <Re************@laborready.com> wrote in message
news:OT*************@TK2MSFTNGP11.phx.gbl...
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" <ks******@takempis.com> wrote in message
news:eg**************@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" <Re************@laborready.com> wrote in message
news:#Y**************@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?


Nov 18 '05 #7

P: n/a
Thanks Ken.

No - not multiple apps. I have set up a web server and set its home
directory as w:\wwwroot\salesnow and configured the application name =
"Salesnow". That same directory is set up as a virtual directory with
identical values. Is that the problem, maybe I don't need the virtual
directory since the web server is dedicated to this site?

FYI: as a test, I set up a Win2K Web server identically (except that it
truely is a virtual web site) and it reacts as designed.

Let me know.
Thanks.
"Ken Dopierala Jr." <kd*********@wi.rr.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Steve,

Are these multiple apps? In your /Pages folder do you have a Bin directory? Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Steve Taylor" <Re************@laborready.com> wrote in message
news:OT*************@TK2MSFTNGP11.phx.gbl...
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" <ks******@takempis.com> wrote in message
news:eg**************@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" <Re************@laborready.com> wrote in message
news:#Y**************@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?



Nov 18 '05 #8

P: n/a
Thanks Kevin,
I agree something is wrong and I'm really suspecting it is on the server
config. Please see my response to Ken for more details. Any ideas will be
much appreciated.
Steve

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:u2**************@TK2MSFTNGP09.phx.gbl...
Hi Steve,

I'm somewhat confused, but I'll take a crack at helping as much as I can.

A web application is defined as a virtual root directory (a directory which is configured in IIS as an Application), and all of the directories
underneath it which are NOT defined as applications. It sounds like your IIS Application configuration is messed up. I would start by taking a look at
that.

Opening a browser window using JavaScript may or may not initiate a new
Session, depending upon the browser. I wouldn't count on it.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Steve Taylor" <Re************@laborready.com> wrote in message
news:OT*************@TK2MSFTNGP11.phx.gbl...
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" <ks******@takempis.com> wrote in message
news:eg**************@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" <Re************@laborready.com> wrote in message
news:#Y**************@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?



Nov 18 '05 #9

P: n/a
You say you "set up a web server and set its home directory as..." Then you
say "That same directory is set up as a virtual directory with identical
values." It sounds like you've got 2 applications pointing to the same
directory. The web server is IIS. I believe you mean you set up a web SITE.
Basically, you've set up 2 virtual directories and applications pointing to
the same directory. Remove the virtual directory you added, and it should be
fine.

The term "virtual directory" can be confusing. A virtual directory is
basically any directory that you map to in IIS. It can be under the default
(C:\Inetpub\wwwroot) web server directory, or it can reside elsewhere, and
be mapped as a virtual directory in IIS. So, in essence, you've created 2
virtual directories from one directory, and created 2 applications that
point to the same directory structure.

.... if I'm understanding you correctly.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Steve Taylor" <Re************@laborready.com> wrote in message
news:#3**************@tk2msftngp13.phx.gbl...
Thanks Ken.

No - not multiple apps. I have set up a web server and set its home
directory as w:\wwwroot\salesnow and configured the application name =
"Salesnow". That same directory is set up as a virtual directory with
identical values. Is that the problem, maybe I don't need the virtual
directory since the web server is dedicated to this site?

FYI: as a test, I set up a Win2K Web server identically (except that it
truely is a virtual web site) and it reacts as designed.

Let me know.
Thanks.
"Ken Dopierala Jr." <kd*********@wi.rr.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Steve,

Are these multiple apps? In your /Pages folder do you have a Bin

directory?
Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Steve Taylor" <Re************@laborready.com> wrote in message
news:OT*************@TK2MSFTNGP11.phx.gbl...
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" <ks******@takempis.com> wrote in message
news:eg**************@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" <Re************@laborready.com> wrote in message
> news:#Y**************@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?
>
>



Nov 18 '05 #10

P: n/a
You are absolutely right! That was the problem and thinking about how it
reacted makes sense in this context.

THANKS FOR ALL YOU DO!
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
You say you "set up a web server and set its home directory as..." Then you say "That same directory is set up as a virtual directory with identical
values." It sounds like you've got 2 applications pointing to the same
directory. The web server is IIS. I believe you mean you set up a web SITE. Basically, you've set up 2 virtual directories and applications pointing to the same directory. Remove the virtual directory you added, and it should be fine.

The term "virtual directory" can be confusing. A virtual directory is
basically any directory that you map to in IIS. It can be under the default (C:\Inetpub\wwwroot) web server directory, or it can reside elsewhere, and
be mapped as a virtual directory in IIS. So, in essence, you've created 2
virtual directories from one directory, and created 2 applications that
point to the same directory structure.

... if I'm understanding you correctly.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Steve Taylor" <Re************@laborready.com> wrote in message
news:#3**************@tk2msftngp13.phx.gbl...
Thanks Ken.

No - not multiple apps. I have set up a web server and set its home
directory as w:\wwwroot\salesnow and configured the application name =
"Salesnow". That same directory is set up as a virtual directory with
identical values. Is that the problem, maybe I don't need the virtual
directory since the web server is dedicated to this site?

FYI: as a test, I set up a Win2K Web server identically (except that it
truely is a virtual web site) and it reacts as designed.

Let me know.
Thanks.
"Ken Dopierala Jr." <kd*********@wi.rr.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Steve,

Are these multiple apps? In your /Pages folder do you have a Bin

directory?
Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Steve Taylor" <Re************@laborready.com> wrote in message
news:OT*************@TK2MSFTNGP11.phx.gbl...
> 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" <ks******@takempis.com> wrote in message
> news:eg**************@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" <Re************@laborready.com> wrote in message
> > news:#Y**************@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?
> >
> >
>
>



Nov 18 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.