Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > global.asa fires after url parameters?

Reply
Thread Tools

global.asa fires after url parameters?

 
 
WaterBug
Guest
Posts: n/a
 
      03-16-2005
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?

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      03-16-2005
=?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)

 
Reply With Quote
 
 
 
 
WaterBug
Guest
Posts: n/a
 
      03-16-2005
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.
 
Reply With Quote
 
Tim
Guest
Posts: n/a
 
      03-16-2005
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
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      03-16-2005
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)

 
Reply With Quote
 
WaterBug
Guest
Posts: n/a
 
      03-17-2005
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.
 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      03-17-2005
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.


 
Reply With Quote
 
WaterBug
Guest
Posts: n/a
 
      03-17-2005
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.
>
>
>

 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      03-17-2005
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" <> a écrit dans le message de
news6EBDE35-3FD7-49A0-BCE0-...
> 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.



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      03-17-2005
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple composite control fires event fires first time but not second sellars.paul@googlemail.com ASP .Net Web Controls 3 05-13-2009 03:19 PM
Repeater ItemCommand fires only after Postback Sparhawk ASP .Net 0 07-21-2004 02:33 PM
adding onchange javascript that fires after doPostBack ? Mad Scientist Jr ASP .Net 3 07-15-2004 07:54 PM
user control event fires after content page page_load mortb ASP .Net 0 05-04-2004 11:46 AM
Problem with refresh after delegate event fires. c# and asp.net. George K ASP .Net 3 11-25-2003 05:48 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57