Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing script src file for server side use

Status
Not open for further replies.

anyideas

Programmer
May 2, 2002
127
GB
Hey All.

I have an asp file called errorCheck.asp which contains a function:

Function Blah()
blah blah
End Function

Theres no <% or %> or <script> tags in this file as its referenced using:

<script src=&quot;errorCheck.asp&quot;>
</script>

I now want to access that function server side... and i'm not quite sure how?

Any help appreciated!

Cheers

Mark
 
Hi

I've not used client-side vbscript, so I may be completely off here, but this is how you call a server-side function (I've assumed that you want to keep the errorCheck.asp file separate to the page calling the function)

'errorCheck.asp
<%
Function Blah()
Blah = &quot;blah&quot;
End Function
%>

'another page which needs to call the Blah function
<!--#INCLUDE VIRTUAL=&quot;/errorCheck.asp&quot;-->
<%
dim b
'call Blah function
b = Blah()

response.write b

'asp code etc etc
%>

However, doing this may mean that you can't call the function in the way that you're currently doing, i.e.

<script src=&quot;errorCheck.asp&quot;>
</script>

Hope this helps,
Beck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top