well you cant literally make it into a componet, but you can however throw some vbscript into a file, like say sub and functions, that you commonly use and name it with a *.inc extension, so at the top of your ASP you do<br><br><!--<#include file mysubs.inc>--><br><br>this will literally include that file into that sectino of the ASP, sort of the same as Cutting and PAsting that text into the ASP , so treat it as part of an ASP document, good thing about this method, is that it lets you include these sets of information onto any of your ASP just by including it, now if you want a conponet like an ActiveX dll, you need to use Visual Basic, or VC++(or any other programming language capable) to compile what you want to do into a dll. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href=
Dear eyal and Karl,<br><br>Karl stated:<br><br>> now if you want a conponet like an ActiveX dll, you need to use <br>> Visual Basic, or VC++(or any other programming language capable) to compile <br>> what you want to do into a dll. <br><br>That's not entirely accurate. You can actually make COM treat VBScript and JScript as an ActiveX control by building your code into a Windows Script Component compatible file. These files use XML to describe the component to COM etc. Check out the information on the MSDN CDROM or at MSDN Online at the following URL.<br><br><A HREF="
In IIS5 you can build a Specific ASP Page and use the server.execute method wich is very similar to an include file.<br><br>Did you know that you can build your own classes within your ASP Code?<br><br>Have a look at the following example:<br><br>Save the following page as ASPCODE.asp<br><%<br>Class aspcode<br> Private myNumber<br> <br> Public Property Get MultiNum<br> MultiNum = myNumber<br> End Property<br><br> Public Property Let MultiNum(NewNum)<br> IF NewNum > 0 Then<br> myNumber = MultiNum<br> End if<br> End Property<br><br> Public Function Result()<br> Result = myNumber * 2<br> End Function<br><br>End Class<br>%><br><br>Now in your actual code you can do the following<br><br><%<br>Server.Execute AspCode.asp<br><br>Set obj = New AspCode<br>obj.MultiNum = 10 'This is the Number you want to Multiply<br>Response.Write obj.Result 'The result will now be 20<br>%><br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.