Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Help

Reply
 
 
Jose
Guest
Posts: n/a
 
      02-23-2004
Can anyone help?

I try to put all my function in a separate .ASP file
under scriptlib folder but when I call any function
from the such asp file do not work meanwhile
if I put the code inside the working asp works fine

explain:
mytools.asp
<%SCRIPT Language="vbscript"%>
function abc(pParam)
abc = "OK"
end function
function xyz(pParam)
xyz = "NOT OK"
end function


Main ASP File
default.asp (Contains)

<%
<script language="vbscript" scr=scriptlib/mytools.asp">
<font face="Verdana" size=1><%=abc("GO")%>
</font>
</script>
%>


TIA
Jo


 
Reply With Quote
 
 
 
 
middletree
Guest
Posts: n/a
 
      02-23-2004
Don't call in an external asp file with the <Script> tag. That's for
client-side code.

Do it in an include file instead


"Jose" <(E-Mail Removed)> wrote in message
news:%232qdcul%(E-Mail Removed)...
> Can anyone help?
>
> I try to put all my function in a separate .ASP file
> under scriptlib folder but when I call any function
> from the such asp file do not work meanwhile
> if I put the code inside the working asp works fine
>
> explain:
> mytools.asp
> <%SCRIPT Language="vbscript"%>
> function abc(pParam)
> abc = "OK"
> end function
> function xyz(pParam)
> xyz = "NOT OK"
> end function
>
>
> Main ASP File
> default.asp (Contains)
>
> <%
> <script language="vbscript" scr=scriptlib/mytools.asp">
> <font face="Verdana" size=1><%=abc("GO")%>
> </font>
> </script>
> %>
>
>
> TIA
> Jo
>
>



 
Reply With Quote
 
 
 
 
Roland Hall
Guest
Posts: n/a
 
      02-24-2004
"Jose" wrote:
: Can anyone help?
:
: I try to put all my function in a separate .ASP file
: under scriptlib folder but when I call any function
: from the such asp file do not work meanwhile
: if I put the code inside the working asp works fine
:
: explain:
: mytools.asp
: <%SCRIPT Language="vbscript"%>
: function abc(pParam)
: abc = "OK"
: end function
: function xyz(pParam)
: xyz = "NOT OK"
: end function
:
:
: Main ASP File
: default.asp (Contains)
:
: <%
: <script language="vbscript" scr=scriptlib/mytools.asp">
: <font face="Verdana" size=1><%=abc("GO")%>
: </font>
: </script>
: %>

Jo...

This is client-side vbscript. You cannot nest the <script> tag. If you
want to call the script via a script tag, then you need to remove that from
the source document. Take out <script language="vbscript"></script> from
mytools.asp.

Another problem you have is syntax.
<% %> or <script runat=server></script>, but not both.

<%<script... is invalid.

Change mytools.asp to:

mytools.asp
<%
function abc(pParam)
abc = "OK"
end function
function xyz(pParam)
xyz = "NOT OK"
end function
%>

Change default.asp to:

<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True
%>
<!--#include file="scriptlib/mytools.asp"-->
<html>
<head>
</head>
<body>
<font face="Verdana" size=1><%=abc("GO")%></font>
</body>
</html>

Or use .css
<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True
%>
<!--#include file="scriptlib/mytools.asp"-->
<html>
<head>
<style type="text/css">
..v1 { font: normal xx-small verdana }
</style>
</head>
<body>
<span class="v1"><%=abc("GO")%></span>
</body>
</html>

HTH...

--
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
 
Roland Hall
Guest
Posts: n/a
 
      02-24-2004
"Roland Hall" wrote:
: "Jose" wrote:
: : Can anyone help?
: :
: : I try to put all my function in a separate .ASP file
: : under scriptlib folder but when I call any function
: : from the such asp file do not work meanwhile
: : if I put the code inside the working asp works fine
: :
: : explain:
: : mytools.asp
: : <%SCRIPT Language="vbscript"%>
: : function abc(pParam)
: : abc = "OK"
: : end function
: : function xyz(pParam)
: : xyz = "NOT OK"
: : end function
: :
: :
: : Main ASP File
: : default.asp (Contains)
: :
: : <%
: : <script language="vbscript" scr=scriptlib/mytools.asp">
: : <font face="Verdana" size=1><%=abc("GO")%>
: : </font>
: : </script>
: : %>
:
: Jo...
:
: This is client-side vbscript. You cannot nest the <script> tag. If you
: want to call the script via a script tag, then you need to remove that
from
: the source document. Take out <script language="vbscript"></script> from
: mytools.asp.
:
: Another problem you have is syntax.
: <% %> or <script runat=server></script>, but not both.
:
: <%<script... is invalid.
:
: Change mytools.asp to:
:
: mytools.asp
: <%
: function abc(pParam)
: abc = "OK"
: end function
: function xyz(pParam)
: xyz = "NOT OK"
: end function
: %>
:
: Change default.asp to:
:
: <%@ Language=VBScript %>
: <%
: Option Explicit
: Response.Buffer = True
: %>
: <!--#include file="scriptlib/mytools.asp"-->
: <html>
: <head>
: </head>
: <body>
: <font face="Verdana" size=1><%=abc("GO")%></font>
: </body>
: </html>
:
: Or use .css
: <%@ Language=VBScript %>
: <%
: Option Explicit
: Response.Buffer = True
: %>
: <!--#include file="scriptlib/mytools.asp"-->
: <html>
: <head>
: <style type="text/css">
: .v1 { font: normal xx-small verdana }
: </style>
: </head>
: <body>
: <span class="v1"><%=abc("GO")%></span>
: </body>
: </html>

A little more info:

<script language="vbscript">

This is client-size and language on client-side has been deprecated. Use
this instead:
<script type="text/vbscript">

On the server-side, you use this:
<script language="vbscript" runat="server">

ONLY ASP code goes in between here:

<% %>

....unless you wrap the code in a Response.Write("")

<%
Response.Write("<html>" & vbCrLf)
%>

HTH...

--
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
 
Josaz
Guest
Posts: n/a
 
      02-26-2004
Thanks Much roland,
Maybe you can answer me this question
I wrote a .DLL in VB6 with the company business rule that I like to use
along with my asp project how do I register it in the server in order for me
to see it as a COM+ I understand that some changes need to be done in the
..DLL Code.

TIA
Jo

"Roland Hall" <nobody@nowhere> wrote in message
news:OFNKzum%(E-Mail Removed)...
> "Roland Hall" wrote:
> : "Jose" wrote:
> : : Can anyone help?
> : :
> : : I try to put all my function in a separate .ASP file
> : : under scriptlib folder but when I call any function
> : : from the such asp file do not work meanwhile
> : : if I put the code inside the working asp works fine
> : :
> : : explain:
> : : mytools.asp
> : : <%SCRIPT Language="vbscript"%>
> : : function abc(pParam)
> : : abc = "OK"
> : : end function
> : : function xyz(pParam)
> : : xyz = "NOT OK"
> : : end function
> : :
> : :
> : : Main ASP File
> : : default.asp (Contains)
> : :
> : : <%
> : : <script language="vbscript" scr=scriptlib/mytools.asp">
> : : <font face="Verdana" size=1><%=abc("GO")%>
> : : </font>
> : : </script>
> : : %>
> :
> : Jo...
> :
> : This is client-side vbscript. You cannot nest the <script> tag. If you
> : want to call the script via a script tag, then you need to remove that
> from
> : the source document. Take out <script language="vbscript"></script>

from
> : mytools.asp.
> :
> : Another problem you have is syntax.
> : <% %> or <script runat=server></script>, but not both.
> :
> : <%<script... is invalid.
> :
> : Change mytools.asp to:
> :
> : mytools.asp
> : <%
> : function abc(pParam)
> : abc = "OK"
> : end function
> : function xyz(pParam)
> : xyz = "NOT OK"
> : end function
> : %>
> :
> : Change default.asp to:
> :
> : <%@ Language=VBScript %>
> : <%
> : Option Explicit
> : Response.Buffer = True
> : %>
> : <!--#include file="scriptlib/mytools.asp"-->
> : <html>
> : <head>
> : </head>
> : <body>
> : <font face="Verdana" size=1><%=abc("GO")%></font>
> : </body>
> : </html>
> :
> : Or use .css
> : <%@ Language=VBScript %>
> : <%
> : Option Explicit
> : Response.Buffer = True
> : %>
> : <!--#include file="scriptlib/mytools.asp"-->
> : <html>
> : <head>
> : <style type="text/css">
> : .v1 { font: normal xx-small verdana }
> : </style>
> : </head>
> : <body>
> : <span class="v1"><%=abc("GO")%></span>
> : </body>
> : </html>
>
> A little more info:
>
> <script language="vbscript">
>
> This is client-size and language on client-side has been deprecated. Use
> this instead:
> <script type="text/vbscript">
>
> On the server-side, you use this:
> <script language="vbscript" runat="server">
>
> ONLY ASP code goes in between here:
>
> <% %>
>
> ...unless you wrap the code in a Response.Write("")
>
> <%
> Response.Write("<html>" & vbCrLf)
> %>
>
> HTH...
>
> --
> 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
 
Roland Hall
Guest
Posts: n/a
 
      02-27-2004
"Josaz" wrote:
: Thanks Much roland,
: Maybe you can answer me this question
: I wrote a .DLL in VB6 with the company business rule that I like to use
: along with my asp project how do I register it in the server in order for
me
: to see it as a COM+ I understand that some changes need to be done in the
: .DLL Code.

Jo...

You register a .dll with regsvr32.
http://www.vb2themax.com/HtmlDoc.asp...&ID=290&Page=3

HTH...

--
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
 
Roland Hall
Guest
Posts: n/a
 
      02-27-2004
"Roland Hall" wrote:
: "Josaz" wrote:
: : Thanks Much roland,
: : Maybe you can answer me this question
: : I wrote a .DLL in VB6 with the company business rule that I like to use
: : along with my asp project how do I register it in the server in order
for
: me
: : to see it as a COM+ I understand that some changes need to be done in
the
: : .DLL Code.
:
: Jo...
:
: You register a .dll with regsvr32.
: http://www.vb2themax.com/HtmlDoc.asp...&ID=290&Page=3

An article that may be of benefit:
http://www.15seconds.com/issue/010212.htm

--
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
 
Josaz
Guest
Posts: n/a
 
      02-27-2004
Thank you again roland, so forth I have done so
Register the .DLL in the Server where IIS is hosting
but when I try to call a function from it I get the ASP error

'- This some part of my asp code.
'- Trying to make it call to my .DLL (COM)
<%@Language="vbscript" RUNAT="Server"%>
<%
Set myFunc = CreateObject("MyDll.CLass")
%>
<%=myFunc.This(this)%>
or
<%
Response.write("myFunc.That(this)")
%>
Error page can not be displayed.

Thanks again

"Roland Hall" <nobody@nowhere> wrote in message
news:%23Le9iyM$(E-Mail Removed)...
> "Roland Hall" wrote:
> : "Josaz" wrote:
> : : Thanks Much roland,
> : : Maybe you can answer me this question
> : : I wrote a .DLL in VB6 with the company business rule that I like to

use
> : : along with my asp project how do I register it in the server in order
> for
> : me
> : : to see it as a COM+ I understand that some changes need to be done in
> the
> : : .DLL Code.
> :
> : Jo...
> :
> : You register a .dll with regsvr32.
> : http://www.vb2themax.com/HtmlDoc.asp...&ID=290&Page=3
>
> An article that may be of benefit:
> http://www.15seconds.com/issue/010212.htm
>
> --
> 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
 
Roland Hall
Guest
Posts: n/a
 
      02-27-2004
"Josaz" wrote:
: Thank you again roland, so forth I have done so
: Register the .DLL in the Server where IIS is hosting
: but when I try to call a function from it I get the ASP error
:
: '- This some part of my asp code.
: '- Trying to make it call to my .DLL (COM)
: <%@Language="vbscript" RUNAT="Server"%>
: <%
: Set myFunc = CreateObject("MyDll.CLass")
: %>
: <%=myFunc.This(this)%>
: or
: <%
: Response.write("myFunc.That(this)")
: %>
: Error page can not be displayed.
:
: Thanks again

Aren't you having a problem with this line?
<%@Language="vbscript" RUNAT="Server"%>

Try:
<%@ Language=VBScript %>

--
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
 
 
 
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
Help Help Help Pentax S5i Help needed (Please) The Martian Digital Photography 14 06-20-2008 07:56 AM
HELP - HELP - HELP =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?= ASP .Net 4 03-09-2006 12:46 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 1 07-16-2004 01:12 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 0 07-16-2004 10:00 AM
HELP! HELP! HELP! Opening Web Application Project Error =?Utf-8?B?dHJlbGxvdzQyMg==?= ASP .Net 0 02-20-2004 05:16 PM



Advertisments