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

Anyone have experience w/ Application["AppState"]?

I stumbled across Application["AppState"] from someone else's code, and I can't
find out squat about by searching MS, Google, or Google Groups.

For the most part, this is returning the fully-qualified name of the server and
path to my application, such as:

http://devserver/testapp

However, on 1 of my test servers, it returns:

http://localhost/testapp

When browsing the app on the server, that isn't a problem, however if remotely
accessing it from another machine, it is still returning localhost. As
mentioned, the same application on 3 other servers behaves as expected where
the servername is appropriately substituted.

The only difference between the servers is the ones that work are running IIS 5
(XP), the one that doesn't is running IIS 4 (2k). Is there some difference
between these IIS versions that would somehow affect how Application["AppPath"]
is initialized?

Thanks
Nov 18 '05 #1
4 1132
This is an application variable that is initialized and stored for later
reuse. If you start browsing from localhost, it will record this path and it
will then be incorrect for other users browsing from outside.
Try first to see if it's ok when the application is first accessed when not
using localhost...

It is likely initialized in the global.asax file.

"Julie" <ju***@nospam.com> a écrit dans le message de
news:40***************@nospam.com...
I stumbled across Application["AppState"] from someone else's code, and I can't find out squat about by searching MS, Google, or Google Groups.

For the most part, this is returning the fully-qualified name of the server and path to my application, such as:

http://devserver/testapp

However, on 1 of my test servers, it returns:

http://localhost/testapp

When browsing the app on the server, that isn't a problem, however if remotely accessing it from another machine, it is still returning localhost. As
mentioned, the same application on 3 other servers behaves as expected where the servername is appropriately substituted.

The only difference between the servers is the ones that work are running IIS 5 (XP), the one that doesn't is running IIS 4 (2k). Is there some difference between these IIS versions that would somehow affect how Application["AppPath"] is initialized?

Thanks

Nov 18 '05 #2
Patrice wrote:

This is an application variable that is initialized and stored for later
reuse. If you start browsing from localhost, it will record this path and it
will then be incorrect for other users browsing from outside.
Try first to see if it's ok when the application is first accessed when not
using localhost...

It is likely initialized in the global.asax file.
Ok, I'm making some progress. What I thought was a predefined value for
AppPath, turns out to be initialized elsewhere in the project (I had searched
the project for occurrences, but nothing showed up for this particular file).

Regardless, I've found the location of the problem, now I need to find a
solution (for the different versions of IIS?).

Thanks

"Julie" <ju***@nospam.com> a écrit dans le message de
news:40***************@nospam.com...
I stumbled across Application["AppState"] from someone else's code, and I

can't
find out squat about by searching MS, Google, or Google Groups.

For the most part, this is returning the fully-qualified name of the

server and
path to my application, such as:

http://devserver/testapp

However, on 1 of my test servers, it returns:

http://localhost/testapp

When browsing the app on the server, that isn't a problem, however if

remotely
accessing it from another machine, it is still returning localhost. As
mentioned, the same application on 3 other servers behaves as expected

where
the servername is appropriately substituted.

The only difference between the servers is the ones that work are running

IIS 5
(XP), the one that doesn't is running IIS 4 (2k). Is there some

difference
between these IIS versions that would somehow affect how

Application["AppPath"]
is initialized?

Thanks

Nov 18 '05 #3
The quicker fix I see would be to change every occurence of
Application["AppPath"] with the corresponding expression used for
initializing this variable (would avoid to have a unique value regardless of
the way the website is accessed).

From a general point of view, you may or may not need the full information.
Generally Request.ApplicationPath ( that returns the root of your
application such as "/testapp") should be enough (assuming you want to keep
the same hostname and the same protocol).

Patrice

"Julie" <ju***@nospam.com> a écrit dans le message de
news:40***************@nospam.com...
Patrice wrote:

This is an application variable that is initialized and stored for later
reuse. If you start browsing from localhost, it will record this path and it will then be incorrect for other users browsing from outside.
Try first to see if it's ok when the application is first accessed when not using localhost...

It is likely initialized in the global.asax file.
Ok, I'm making some progress. What I thought was a predefined value for
AppPath, turns out to be initialized elsewhere in the project (I had

searched the project for occurrences, but nothing showed up for this particular file).
Regardless, I've found the location of the problem, now I need to find a
solution (for the different versions of IIS?).

Thanks

"Julie" <ju***@nospam.com> a écrit dans le message de
news:40***************@nospam.com...
I stumbled across Application["AppState"] from someone else's code, and I
can't
find out squat about by searching MS, Google, or Google Groups.

For the most part, this is returning the fully-qualified name of the

server and
path to my application, such as:

http://devserver/testapp

However, on 1 of my test servers, it returns:

http://localhost/testapp

When browsing the app on the server, that isn't a problem, however if

remotely
accessing it from another machine, it is still returning localhost.
As mentioned, the same application on 3 other servers behaves as expected

where
the servername is appropriately substituted.

The only difference between the servers is the ones that work are

running IIS 5
(XP), the one that doesn't is running IIS 4 (2k). Is there some

difference
between these IIS versions that would somehow affect how

Application["AppPath"]
is initialized?

Thanks

Nov 18 '05 #4
Patrice wrote:

The quicker fix I see would be to change every occurence of
Application["AppPath"] with the corresponding expression used for
initializing this variable (would avoid to have a unique value regardless of
the way the website is accessed).

From a general point of view, you may or may not need the full information.
Generally Request.ApplicationPath ( that returns the root of your
application such as "/testapp") should be enough (assuming you want to keep
the same hostname and the same protocol).
Yes, good comments. The original intention by the original author (which I'm
not) was to provide a way in the ASPX pages to properly define paths (to images
in this case) regardless of where the page is located in the site hierarchy,
and regardless of where the site was originally installed in the web server
hierarchy.

The entire qualified name is _not_ needed, so I may be better off using the
Request.ApplicationPath as you point out.

Thanks again for your comments and suggestions.


"Julie" <ju***@nospam.com> a écrit dans le message de
news:40***************@nospam.com...
Patrice wrote:

This is an application variable that is initialized and stored for later
reuse. If you start browsing from localhost, it will record this path and it will then be incorrect for other users browsing from outside.
Try first to see if it's ok when the application is first accessed when not using localhost...

It is likely initialized in the global.asax file.


Ok, I'm making some progress. What I thought was a predefined value for
AppPath, turns out to be initialized elsewhere in the project (I had

searched
the project for occurrences, but nothing showed up for this particular

file).

Regardless, I've found the location of the problem, now I need to find a
solution (for the different versions of IIS?).

Thanks

"Julie" <ju***@nospam.com> a écrit dans le message de
news:40***************@nospam.com...
> I stumbled across Application["AppState"] from someone else's code, and I can't
> find out squat about by searching MS, Google, or Google Groups.
>
> For the most part, this is returning the fully-qualified name of the
server and
> path to my application, such as:
>
> http://devserver/testapp
>
> However, on 1 of my test servers, it returns:
>
> http://localhost/testapp
>
> When browsing the app on the server, that isn't a problem, however if
remotely
> accessing it from another machine, it is still returning localhost. As > mentioned, the same application on 3 other servers behaves as expected
where
> the servername is appropriately substituted.
>
> The only difference between the servers is the ones that work are running IIS 5
> (XP), the one that doesn't is running IIS 4 (2k). Is there some
difference
> between these IIS versions that would somehow affect how
Application["AppPath"]
> is initialized?
>
> Thanks

Nov 18 '05 #5

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

Similar topics

4
by: Julie | last post by:
I stumbled across Application from someone else's code, and I can't find out squat about by searching MS, Google, or Google Groups. For the most part, this is returning the fully-qualified name...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.