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

global.asa fires after url parameters?

When clicking on the following link from an email i.e -
http://myserver/myapplication/myprog...2=more%20stuff
I get a server 500 error. With that same browser window open, if I click
the link from the email again I get the desired page. The results are the
same if the url is copied and pasted into the brower but the 'go' must be
pressed twice.

It appears that the server is trying to resolve the url vars before the
global.asa is fired. Does anyone know of the order of processing? Any
suggestions?

Jul 22 '05 #1
16 2254
=?Utf-8?B?V2F0ZXJCdWc=?= wrote on 16 mrt 2005 in
microsoft.public.inetserver.asp.general:
When clicking on the following link from an email i.e -
http://myserver/myapplication/myprog...20stuff&urlvar
2=more%20stuff I get a server 500 error. With that same browser
window open, if I click the link from the email again I get the
desired page. The results are the same if the url is copied and
pasted into the brower but the 'go' must be pressed twice.
This is a emailclient cum browser issue, IMHO

It appears that the server is trying to resolve the url vars before
the global.asa is fired. Does anyone know of the order of processing?
Any suggestions?


global.asa does not fire every time a page is called, only at a [re]start
of the server/IIS.

Why do you think global.asa has anything to do with it?
Try the same without any global.asa present.
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #2
E: This is a emailclient cum browser issue, IMHO
W: I don't believe this is an emailclient issue. I can create the problem
without email. If you start a new browser and paste the url with the
urlvariables then the error occurs. The page requires the URL variables to
locate the specific recordset from the database and the session must be
started prior to that to establish connectionString, who you are, your
security, and more.

E: global.asa does not fire every time a page is called, only at a [re]start
of the server/IIS.
W: It fires every time I open a new browser and call my application. It
starts a new unique session for each browser conversation with the
application. This is only an issue if a session is not established.

E: Why do you think global.asa has anything to do with it? Try the same
without any global.asa present.
W: My app won't work without global.asa present. I rely on many session
vars for db connectivity and resolving security.

W: I think it is global.asa since the first time I type in the url and press
'go' or enter I get the error but the second time I press 'go' or enter the
page is delivered correctly. I think on the first trip to the server, the
server 1) attempts to resolve the url vars first, 2) then processes the
global.asa, 3) then attempts to deliver my page but my url vars are no longer
available. On the 2nd trip to the server, the session was established in the
1st trip and now the url vars are resolved correctly.

I am still in search of the order of processing by the server for an asp
request.
Jul 22 '05 #3
Tim
WaterBug wrote:
E: This is a emailclient cum browser issue, IMHO
W: I don't believe this is an emailclient issue. I can create the problem
Not a big issue but I suggest using ordinare quoting (like I do here) in
the future to increase the chance of good responses.
without email. If you start a new browser and paste the url with the I dontt think this is not an email program issue
E: global.asa does not fire every time a page is called, only at a [re]start
of the server/IIS.
W: It fires every time I open a new browser and call my application. It
starts a new unique session for each browser conversation with the
application. This is only an issue if a session is not established.
Application_OnStart fires only when your application starts, that is
generally only the first time a page is requested after you have made
changes to global.asa.
E: Why do you think global.asa has anything to do with it? Try the same
without any global.asa present.
W: My app won't work without global.asa present. I rely on many session
vars for db connectivity and resolving security.
Session_OnStart is caled once when a new session starts. This means, if
you browse the site, Session_onstart is only called the fist time you go
to the first page.

A new session might start when you start another webbrowser but I guess
that is a settings thing?

Anyway, I am still in search of the order of processing by the server for an
asp request.
It appears that the server is trying to resolve the url vars before the
global.asa is fired. Does anyone know of the order of processing? Any
suggestions?


The url vars are never automatically resolved.

If it is a new session, session_onstart is called first, in there you
might resolve the url vars with request.querystring if you want.

When session_onstart is ran to the end (or imediatley if this is your
second request) your asp page will be compiled and run from the top to
the bottom.

If you post the content of your global asa and myprogram.asp I am sure
it will be much easier to spot the error.

Tim
Jul 22 '05 #4
Dear waterbug,

Tim wrote on 16 mrt 2005 in microsoft.public.inetserver.asp.general:
E: Why do you think global.asa has anything to do with it? Try the
same without any global.asa present.
W: My app won't work without global.asa present. I rely on many
session vars for db connectivity and resolving security.


Session_OnStart is caled once when a new session starts. This means,
if you browse the site, Session_onstart is only called the fist time
you go to the first page.


Tim is right. [also on the quoting issue, but that aside]

The fact that Session_OnStart is called at the beginning of every new
session does not mean that global.asa is run. Global.asa runs only at
the application start. Session_OnStart sub is helt in memory.

I suppose your problem is a session problem. If the session is not helt,
because the browser does not allow a ram-cookie, every page is a new
session with a new call to the Session_OnStart sub. ASP pages are always
a session.

However without relevant code we cannot envision the exact nature of
your problem.

btw, did you try to debug?

========================
I rely on many session vars for db connectivity and resolving
security.


And you initialize those session variables [we are talking session() ?]
in Session_OnStart?

Why?
They can more easily be initialized on your entry page, easying the
debugging process. Or if you have multiple entry possiblilities, with a
include statement.

That way you can have administrative entry using a different security
appoach for your own purpose. Or differnt [open?] pages in another part
of your site.
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #5
Let me try to rephrase my problem. On a page call that invokes a new unique
application/session, the included query string (URL parameters) that are
passed are trashed, ignored, stripped (however you want to say it). Is it
true that the server's asp process will ignore URL variables if the page
invokes a new session? Is it impossible to refer to URL parameters on the
page that starts a session. It appears I am unable to refer to URL
parameters in an asp page that invokes a session.
Jul 22 '05 #6
WaterBug wrote:
Let me try to rephrase my problem. On a page call that invokes a new
unique application/session, the included query string (URL
parameters) that are passed are trashed, ignored, stripped (however
you want to say it). Is it true that the server's asp process will
ignore URL variables if the page invokes a new session? Is it
impossible to refer to URL parameters on the page that starts a
session. It appears I am unable to refer to URL parameters in an asp
page that invokes a session.


Create a small page (or set of pages) that illustrates your problem. This
description is hard to follow.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #7
You can. IMO the problem is rather that you have some error in your
global.asa file having then an error just when the session starts...

You should start by disabling simplified HTTP errors to that you can clearly
see what this 500 error is exactly...

Patrice
--

"WaterBug" <Wa******@discussions.microsoft.com> a écrit dans le message de
news:D6**********************************@microsof t.com...
Let me try to rephrase my problem. On a page call that invokes a new unique application/session, the included query string (URL parameters) that are
passed are trashed, ignored, stripped (however you want to say it). Is it
true that the server's asp process will ignore URL variables if the page
invokes a new session? Is it impossible to refer to URL parameters on the
page that starts a session. It appears I am unable to refer to URL
parameters in an asp page that invokes a session.

Jul 22 '05 #8
The browser call..
http://127.0.0.1/MyApp/EvalPage.asp?...lly&type=orbit

MyApp is defined as an application in IIS...

The contents of EvalPage.asp...
<%@ Language=VBScript %>
<%option explicit

response.Write "Trainee= " & request("trainee") & " Evaluator= " &
request("evaluator") & " type= " & request("type")

response.Write "<br>query_string= " & request.ServerVariables("query_string")
response.Write "<br>request_uri= " & request.ServerVariables("request_uri")
response.Write "<br>path_info= " & request.ServerVariables("path_info")
response.Write "<br>path_translated= " &
request.ServerVariables("path_translated")
response.Write "<br>http_host= " & request.ServerVariables("http_host")
response.Write "<br>http_referer= " & request.ServerVariables("http_referer")
response.Write "<br>path= " & request.ServerVariables("path")
%>

The first time the URL listed above is requested the query_string is
returned as an empty string. Repaste the URL (cause the query_string gets
stripped) and the query_string is returned...k

"Bob Barrows [MVP]" wrote:
WaterBug wrote:
Let me try to rephrase my problem. On a page call that invokes a new
unique application/session, the included query string (URL
parameters) that are passed are trashed, ignored, stripped (however
you want to say it). Is it true that the server's asp process will
ignore URL variables if the page invokes a new session? Is it
impossible to refer to URL parameters on the page that starts a
session. It appears I am unable to refer to URL parameters in an asp
page that invokes a session.


Create a small page (or set of pages) that illustrates your problem. This
description is hard to follow.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 22 '05 #9
WaterBug wrote:
The browser call...
http://127.0.0.1/MyApp/EvalPage.asp?...lly&type=orbit
MyApp is defined as an application in IIS...

The contents of EvalPage.asp...
<%@ Language=VBScript %> <snip> The first time the URL listed above is requested the query_string is
returned as an empty string.


By "returned", do you mean the

response.Write "query_string= " & _
request.ServerVariables("query_string")

statement writes an empty string?

No, that does not happen to me. I'm using IE6 on a Win2000 machine. What are
you using?

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #10
Works fine for me. Is there a global.asa file that is supposed to go along
with this?

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"WaterBug" <Wa******@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
The browser call...
http://127.0.0.1/MyApp/EvalPage.asp?...lly&type=orbit

MyApp is defined as an application in IIS...

The contents of EvalPage.asp...
<%@ Language=VBScript %>
<%option explicit

response.Write "Trainee= " & request("trainee") & " Evaluator= " &
request("evaluator") & " type= " & request("type")

response.Write "<br>query_string= " &
request.ServerVariables("query_string")
response.Write "<br>request_uri= " &
request.ServerVariables("request_uri")
response.Write "<br>path_info= " & request.ServerVariables("path_info")
response.Write "<br>path_translated= " &
request.ServerVariables("path_translated")
response.Write "<br>http_host= " & request.ServerVariables("http_host")
response.Write "<br>http_referer= " &
request.ServerVariables("http_referer")
response.Write "<br>path= " & request.ServerVariables("path")
%>

The first time the URL listed above is requested the query_string is
returned as an empty string. Repaste the URL (cause the query_string gets
stripped) and the query_string is returned...k

"Bob Barrows [MVP]" wrote:
WaterBug wrote:
> Let me try to rephrase my problem. On a page call that invokes a new
> unique application/session, the included query string (URL
> parameters) that are passed are trashed, ignored, stripped (however
> you want to say it). Is it true that the server's asp process will
> ignore URL variables if the page invokes a new session? Is it
> impossible to refer to URL parameters on the page that starts a
> session. It appears I am unable to refer to URL parameters in an asp
> page that invokes a session.


Create a small page (or set of pages) that illustrates your problem. This
description is hard to follow.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 22 '05 #11
"Bob Barrows [MVP]" wrote:
WaterBug wrote:
The browser call...

http://127.0.0.1/MyApp/EvalPage.asp?
trainee=astronaut&evaluator=kelly&type=orbit

MyApp is defined as an application in IIS...

The contents of EvalPage.asp...
<%@ Language=VBScript %>

<snip>
The first time the URL listed above is requested the query_string is
returned as an empty string.


By "returned", do you mean the

response.Write "query_string= " & _
request.ServerVariables("query_string")

statement writes an empty string?

No, that does not happen to me. I'm using IE6 on a Win2000 machine. What are
you using?


The first paste of the URL
(http://127.0.0.1/MyApp/EvalPage.asp?
trainee=astronaut&evaluator=kelly&type=orbit)
into the Address line of the browser writes query_string as an empty string
(or query_string=) . When pasting the URL into the address line the second
time (thus requesting a second trip to the server) the browser writes
query_string= trainee=astronaut&evaluator=kelly&type=orbit

Jul 22 '05 #12
WaterBug wrote:
"Bob Barrows [MVP]" wrote:
WaterBug wrote:
The browser call...

http://127.0.0.1/MyApp/EvalPage.asp?
trainee=astronaut&evaluator=kelly&type=orbit

MyApp is defined as an application in IIS...

The contents of EvalPage.asp...
<%@ Language=VBScript %>

<snip>
The first time the URL listed above is requested the query_string is
returned as an empty string.


By "returned", do you mean the

response.Write "query_string= " & _
request.ServerVariables("query_string")

statement writes an empty string?

No, that does not happen to me. I'm using IE6 on a Win2000 machine.
What are you using?


The first paste of the URL
(http://127.0.0.1/MyApp/EvalPage.asp?
trainee=astronaut&evaluator=kelly&type=orbit)
into the Address line of the browser writes query_string as an empty
string (or query_string=) . When pasting the URL into the address
line the second time (thus requesting a second trip to the server)
the browser writes query_string=
trainee=astronaut&evaluator=kelly&type=orbit


As I said: it does not happen to me. I agree with the others: you have a
problem in your global.file.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #13
I have recreated a project in Visual Studio 2003 and everything works fine
when there is no global.asa. When I add a global.asa that does very little
or an empty global.asa then the page url variables are not recognized during
the first load. The behavior is again demonstrated that only during the
second load does the query_string get recognized. Can one of you add an
empty global.asa in your project to see if this 'breaks' it? Thanks...k

"Bob Barrows [MVP]" wrote:
WaterBug wrote:
"Bob Barrows [MVP]" wrote:
WaterBug wrote:
The browser call...

http://127.0.0.1/MyApp/EvalPage.asp?
trainee=astronaut&evaluator=kelly&type=orbit

MyApp is defined as an application in IIS...

The contents of EvalPage.asp...
<%@ Language=VBScript %>
<snip>
The first time the URL listed above is requested the query_string is
returned as an empty string.

By "returned", do you mean the

response.Write "query_string= " & _
request.ServerVariables("query_string")

statement writes an empty string?

No, that does not happen to me. I'm using IE6 on a Win2000 machine.
What are you using?


The first paste of the URL
(http://127.0.0.1/MyApp/EvalPage.asp?
trainee=astronaut&evaluator=kelly&type=orbit)
into the Address line of the browser writes query_string as an empty
string (or query_string=) . When pasting the URL into the address
line the second time (thus requesting a second trip to the server)
the browser writes query_string=
trainee=astronaut&evaluator=kelly&type=orbit


As I said: it does not happen to me. I agree with the others: you have a
problem in your global.file.

Jul 22 '05 #14
No problem here. What if you use Request.QueryString ?

Try also with an emply global.asa (rather than with doing a minimal amount
for things we have no idea about).

Are you sure this is not a cache issue ?

Patrice

--

"WaterBug" <co*****@saic.com> a écrit dans le message de
news:63**********************************@microsof t.com...
I have recreated a project in Visual Studio 2003 and everything works fine
when there is no global.asa. When I add a global.asa that does very little or an empty global.asa then the page url variables are not recognized during the first load. The behavior is again demonstrated that only during the
second load does the query_string get recognized. Can one of you add an
empty global.asa in your project to see if this 'breaks' it? Thanks...k

"Bob Barrows [MVP]" wrote:
WaterBug wrote:
"Bob Barrows [MVP]" wrote:
> WaterBug wrote:
>> The browser call...
>>
>> http://127.0.0.1/MyApp/EvalPage.asp?
>> trainee=astronaut&evaluator=kelly&type=orbit
>>
>> MyApp is defined as an application in IIS...
>>
>> The contents of EvalPage.asp...
>> <%@ Language=VBScript %>
> <snip>
>> The first time the URL listed above is requested the query_string is
>> returned as an empty string.
>
> By "returned", do you mean the
>
> response.Write "query_string= " & _
> request.ServerVariables("query_string")
>
> statement writes an empty string?
>
> No, that does not happen to me. I'm using IE6 on a Win2000 machine.
> What are you using?

The first paste of the URL
(http://127.0.0.1/MyApp/EvalPage.asp?
trainee=astronaut&evaluator=kelly&type=orbit)
into the Address line of the browser writes query_string as an empty
string (or query_string=) . When pasting the URL into the address
line the second time (thus requesting a second trip to the server)
the browser writes query_string=
trainee=astronaut&evaluator=kelly&type=orbit


As I said: it does not happen to me. I agree with the others: you have a
problem in your global.file.

Jul 22 '05 #15
Don't make us guess what you mean by "empty global.asa". Post the global.asa
code that causes the problem for you.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"WaterBug" <co*****@saic.com> wrote in message
news:63**********************************@microsof t.com...
I have recreated a project in Visual Studio 2003 and everything works fine
when there is no global.asa. When I add a global.asa that does very little or an empty global.asa then the page url variables are not recognized during the first load. The behavior is again demonstrated that only during the
second load does the query_string get recognized. Can one of you add an
empty global.asa in your project to see if this 'breaks' it? Thanks...k

"Bob Barrows [MVP]" wrote:
WaterBug wrote:
"Bob Barrows [MVP]" wrote:
> WaterBug wrote:
>> The browser call...
>>
>> http://127.0.0.1/MyApp/EvalPage.asp?
>> trainee=astronaut&evaluator=kelly&type=orbit
>>
>> MyApp is defined as an application in IIS...
>>
>> The contents of EvalPage.asp...
>> <%@ Language=VBScript %>
> <snip>
>> The first time the URL listed above is requested the query_string is
>> returned as an empty string.
>
> By "returned", do you mean the
>
> response.Write "query_string= " & _
> request.ServerVariables("query_string")
>
> statement writes an empty string?
>
> No, that does not happen to me. I'm using IE6 on a Win2000 machine.
> What are you using?

The first paste of the URL
(http://127.0.0.1/MyApp/EvalPage.asp?
trainee=astronaut&evaluator=kelly&type=orbit)
into the Address line of the browser writes query_string as an empty
string (or query_string=) . When pasting the URL into the address
line the second time (thus requesting a second trip to the server)
the browser writes query_string=
trainee=astronaut&evaluator=kelly&type=orbit


As I said: it does not happen to me. I agree with the others: you have a
problem in your global.file.

Jul 22 '05 #16
All of my projects have a global.asa file, including the one I tested your
code with.

Bob Barrows
WaterBug wrote:
I have recreated a project in Visual Studio 2003 and everything works
fine when there is no global.asa. When I add a global.asa that does
very little or an empty global.asa then the page url variables are
not recognized during the first load. The behavior is again
demonstrated that only during the second load does the query_string
get recognized. Can one of you add an empty global.asa in your
project to see if this 'breaks' it? Thanks...k

"Bob Barrows [MVP]" wrote:
WaterBug wrote:
"Bob Barrows [MVP]" wrote:
WaterBug wrote:
> The browser call...
>
> http://127.0.0.1/MyApp/EvalPage.asp?
> trainee=astronaut&evaluator=kelly&type=orbit
>
> MyApp is defined as an application in IIS...
>
> The contents of EvalPage.asp...
> <%@ Language=VBScript %>
<snip>
> The first time the URL listed above is requested the query_string
> is returned as an empty string.

By "returned", do you mean the

response.Write "query_string= " & _
request.ServerVariables("query_string")

statement writes an empty string?

No, that does not happen to me. I'm using IE6 on a Win2000 machine.
What are you using?

The first paste of the URL
(http://127.0.0.1/MyApp/EvalPage.asp?
trainee=astronaut&evaluator=kelly&type=orbit)
into the Address line of the browser writes query_string as an empty
string (or query_string=) . When pasting the URL into the address
line the second time (thus requesting a second trip to the server)
the browser writes query_string=
trainee=astronaut&evaluator=kelly&type=orbit


As I said: it does not happen to me. I agree with the others: you
have a problem in your global.file.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #17

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

Similar topics

3
by: Phil Lamey | last post by:
Hi All, I have the following code but for some reason I cannot get the Session_OnEnd event to fire. I am trying to limit the amount of connections a browser session can have. Where the...
0
by: Tim::.. | last post by:
Hi, Can someone please tell me why I get this error when I try to build my ASP.NET application??? Could not load type 'CPNNet.Global'. Line 1: <%@ Application Codebehind="Global.asax.vb"...
1
by: Stu | last post by:
Hi, Im using vis studio 2003 and I think wse is out of the question as clients could be using java which doesnt support it. So I managed to find some code which allows you to develop a custom...
19
by: furiousmojo | last post by:
This is a strange problem. I have a project where the contents of global.asax application_error are not firing. It is an asp.net 2.0 application using web application projects. I have another...
3
by: thomson | last post by:
Hi All, i do have an website with the URL http://localhost/application/ASEAN-ANZ, Once i hit the application, it goes to the Global.asax. but after that if i tried to change the URL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.