Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Included function not always found.

Reply
Thread Tools

Included function not always found.

 
 
TomB
Guest
Posts: n/a
 
      05-19-2004
I have a function on an "included" page.

For reasons unknown to me I frequently will get an error - to the effect
that the function can't be found.

If I hit refresh/F5 it loads the page just fine.

It doesn't happen often .. maybe once every 50 pages. It also doesn't
happen on any specific page.

I'd show code, but it's not really related to either the function or any
specific page.

Is there any sort of a delay between Asp loading the "includes" and
processing the rest of the page? I'm wondering if the function is getting
called before the include is pulled in.

Thanks
TomB


 
Reply With Quote
 
 
 
 
Roland Hall
Guest
Posts: n/a
 
      05-19-2004
"TomB" wrote in message news:(E-Mail Removed)...
: I have a function on an "included" page.
:
: For reasons unknown to me I frequently will get an error - to the effect
: that the function can't be found.
:
: If I hit refresh/F5 it loads the page just fine.
:
: It doesn't happen often .. maybe once every 50 pages. It also doesn't
: happen on any specific page.
:
: I'd show code, but it's not really related to either the function or any
: specific page.
:
: Is there any sort of a delay between Asp loading the "includes" and
: processing the rest of the page? I'm wondering if the function is getting
: called before the include is pulled in.

Sounds like. Are you trying to call for the function before the page is
fully loaded?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      05-19-2004
Roland Hall wrote:
>> ...I'm wondering if the function is getting called before the
>> include is pulled in.

>
> Sounds like. Are you trying to call for the function before the page
> is fully loaded?


If this is truly an ASP issue (rather than client-side), this should not
happen. The #include directive is processed before anything else happens,
and the whole script is parsed, establishing the namespace. Functions get
special treatment -- they can be called from anywhere, even from blocks that
execute first.

I am watching this thread with great interest, as it suggests a real IIS
bug.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.


 
Reply With Quote
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      05-19-2004
> Sounds like. Are you trying to call for the function before the page is
> fully loaded?


This would only apply if it's a <script src> on the client.

In ASP, the page doesn't even START "loading" until the #includes are
resolved.


 
Reply With Quote
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      05-19-2004
> I have a function on an "included" page.

Can you explain what you mean by "included"? Do you mean #include, or
something else? Why the quotes?

> For reasons unknown to me I frequently will get an error - to the effect
> that the function can't be found.


Can you show the exact error, as opposed to "to the effect..."?

> I'm wondering if the function is getting
> called before the include is pulled in.


As I explained in my other reply, this isn't possible. The rest of the ASP
doesn't exist until the #include file contents are injected into the
processing stream.

A


 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      05-20-2004
"Aaron Bertrand - MVP" <(E-Mail Removed)> wrote in message
news:OmL%(E-Mail Removed)...
: > Sounds like. Are you trying to call for the function before the page is
: > fully loaded?
:
: This would only apply if it's a <script src> on the client.
:
: In ASP, the page doesn't even START "loading" until the #includes are
: resolved.

Thanks for including that (no pun intended). (O:= I knew I read somewhere,
but couldn't locate it, that if the include has client script, it still may
not be resolved even though the onload event fired. Perhaps someone can
find that discussion.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


 
Reply With Quote
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      05-20-2004
> Thanks for including that (no pun intended). (O:= I knew I read
> somewhere,
> but couldn't locate it, that if the include has client script, it still
> may
> not be resolved even though the onload event fired.


It would be the client-side script that may not be resolved, not an ASP
function you call from other segments of ASP code.


 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      05-20-2004
"Aaron Bertrand [MVP]" wrote in message
news:(E-Mail Removed)...
: > Thanks for including that (no pun intended). (O:= I knew I read
: > somewhere,
: > but couldn't locate it, that if the include has client script, it still
: > may
: > not be resolved even though the onload event fired.
:
: It would be the client-side script that may not be resolved, not an ASP
: function you call from other segments of ASP code.

Would that be true even if the ASP included code was client script?

Ex. I have files that are nothing more than client-side javascript code but
need to be wrapped in ASP because I'm mixing values from the server-side,
linking that to a common ASP file that is included in numerous files.

document.shoppingform.action='<%=cartPath%>checkou t.asp';

Which is linked with:
<script type="text/javascript" src="somejsfile.asp"></script>

....into a file that is included in all others.

This is then included into other files with:
<!--#include virtual="/somepath/somefile.asp"-->

Granted I'm not experiencing the issue the OP is but is this a possibility
for that issue?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


 
Reply With Quote
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      05-20-2004
> Granted I'm not experiencing the issue the OP is but is this a possibility
> for that issue?


I really don't think so. ASP is executed this way:

#includes are resolved
ASP is processed
Client-side script can proceed

I don't think there are any scenarios where any of these steps can attempt
to cross paths...


 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      05-20-2004
"Aaron Bertrand [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
: > Granted I'm not experiencing the issue the OP is but is this a
possibility
: > for that issue?
:
: I really don't think so. ASP is executed this way:
:
: #includes are resolved
: ASP is processed
: Client-side script can proceed
:
: I don't think there are any scenarios where any of these steps can attempt
: to cross paths...

Ok. Thank you.


 
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
Use a core C function not included in intern.h Shinku Fag Ruby 4 06-05-2010 06:30 PM
Object not found, included .js file not loading jodleren Javascript 1 09-18-2008 04:37 PM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
Trying to create a CSS box that is always is always the width of an image placed inside it (and no wider) Deryck HTML 4 06-22-2004 08:25 PM
Using parent's function from child when included from file... Troy Javascript 1 10-01-2003 03:46 PM



Advertisments