Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jose

    Help

    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="vbscr ipt"%>
    function abc(pParam)
    abc = "OK"
    end function
    function xyz(pParam)
    xyz = "NOT OK"
    end function


    Main ASP File
    default.asp (Contains)

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


    TIA
    Jo


  • middletree

    #2
    Re: Help

    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" <jose@nospam.co m> wrote in message
    news:%232qdcul% 23DHA.3816@TK2M SFTNGP09.phx.gb l...[color=blue]
    > 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="vbscr ipt"%>
    > function abc(pParam)
    > abc = "OK"
    > end function
    > function xyz(pParam)
    > xyz = "NOT OK"
    > end function
    >
    >
    > Main ASP File
    > default.asp (Contains)
    >
    > <%
    > <script language="vbscr ipt" scr=scriptlib/mytools.asp">
    > <font face="Verdana" size=1><%=abc(" GO")%>
    > </font>
    > </script>
    > %>
    >
    >
    > TIA
    > Jo
    >
    >[/color]


    Comment

    • Roland Hall

      #3
      Re: Help

      "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="vbscr ipt"%>
      : function abc(pParam)
      : abc = "OK"
      : end function
      : function xyz(pParam)
      : xyz = "NOT OK"
      : end function
      :
      :
      : Main ASP File
      : default.asp (Contains)
      :
      : <%
      : <script language="vbscr ipt" 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="vbscr ipt"></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=VBScri pt %>
      <%
      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=VBScri pt %>
      <%
      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"><%=a bc("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


      Comment

      • Roland Hall

        #4
        Re: Help

        "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="vbscr ipt"%>
        : : function abc(pParam)
        : : abc = "OK"
        : : end function
        : : function xyz(pParam)
        : : xyz = "NOT OK"
        : : end function
        : :
        : :
        : : Main ASP File
        : : default.asp (Contains)
        : :
        : : <%
        : : <script language="vbscr ipt" 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="vbscr ipt"></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=VBScri pt %>
        : <%
        : 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=VBScri pt %>
        : <%
        : 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"><%=a bc("GO")%></span>
        : </body>
        : </html>

        A little more info:

        <script language="vbscr ipt">

        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="vbscr ipt" 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


        Comment

        • Josaz

          #5
          Re: Help

          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%23 DHA.2292@TK2MSF TNGP12.phx.gbl. ..[color=blue]
          > "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="vbscr ipt"%>
          > : : function abc(pParam)
          > : : abc = "OK"
          > : : end function
          > : : function xyz(pParam)
          > : : xyz = "NOT OK"
          > : : end function
          > : :
          > : :
          > : : Main ASP File
          > : : default.asp (Contains)
          > : :
          > : : <%
          > : : <script language="vbscr ipt" 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="vbscr ipt"></script>[/color]
          from[color=blue]
          > : 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=VBScri pt %>
          > : <%
          > : 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=VBScri pt %>
          > : <%
          > : 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"><%=a bc("GO")%></span>
          > : </body>
          > : </html>
          >
          > A little more info:
          >
          > <script language="vbscr ipt">
          >
          > 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="vbscr ipt" 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 -[/color]
          http://msdn.microsoft.com/downloads/list/webdev.asp[color=blue]
          > MSDN Library - http://msdn.microsoft.com/library/default.asp
          >
          >[/color]


          Comment

          • Roland Hall

            #6
            Re: Help

            "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.


            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


            Comment

            • Roland Hall

              #7
              Re: Help

              "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:


              --
              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


              Comment

              • Josaz

                #8
                Re: Help

                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="vb script" RUNAT="Server"% >
                <%
                Set myFunc = CreateObject("M yDll.CLass")
                %>
                <%=myFunc.This( this)%>
                or
                <%
                Response.write( "myFunc.That(th is)")
                %>
                Error page can not be displayed.

                Thanks again

                "Roland Hall" <nobody@nowhere > wrote in message
                news:%23Le9iyM$ DHA.1844@TK2MSF TNGP11.phx.gbl. ..[color=blue]
                > "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[/color]
                use[color=blue]
                > : : 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 -[/color]
                http://msdn.microsoft.com/downloads/list/webdev.asp[color=blue]
                > MSDN Library - http://msdn.microsoft.com/library/default.asp
                >
                >[/color]


                Comment

                • Roland Hall

                  #9
                  Re: Help

                  "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="vb script" RUNAT="Server"% >
                  : <%
                  : Set myFunc = CreateObject("M yDll.CLass")
                  : %>
                  : <%=myFunc.This( this)%>
                  : or
                  : <%
                  : Response.write( "myFunc.That(th is)")
                  : %>
                  : Error page can not be displayed.
                  :
                  : Thanks again

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

                  Try:
                  <%@ Language=VBScri pt %>

                  --
                  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


                  Comment

                  Working...