By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,761 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,761 IT Pros & Developers. It's quick & easy.

use vb.net function from classic asp page

P: n/a
I have a web application that contains asp.net and classic asp pages.
I have a vb.net function that I would like to use in one of the classic
asp pages. How can I do this? Can I do this?

Thanks,
Kent.

Mar 19 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I am assuming that your Classic ASP page(s) use VBScript for the server-side
code. If this is true, then no, you can't. Because the .NET code is compiled
(you create a .dll file) and Classic ASP code is interpreted (it does not
require a compiler, you just need a web server that supports Classic ASP),
they server-side code cannot be shared between them. However, one thing that
could make it easier to write code that does the same thing for Classic ASP
is to use the same, or a similar, algorithm to write a version for VBScript.
This shouldn't be too hard since many of the basic constructs are the same
in VBScript and VB.NET. But my personal advice would be to simply convert
the Classic ASP page(s) to ASP.NET, it is not a good idea to mix Classic ASP
and ASP.NET. If you would like any help doing any of these things, let me
know, I have worked with Classic ASP, VBScript, ASP.NET, and VB.NET.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

<Ke************@gmail.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
I have a web application that contains asp.net and classic asp pages.
I have a vb.net function that I would like to use in one of the classic
asp pages. How can I do this? Can I do this?

Thanks,
Kent.

Mar 20 '06 #2

P: n/a
Thanks for the help Nathan.

Kent.

Mar 20 '06 #3

P: n/a
Expose your .NET code as a COM object. Then both VBScript and JScript could
access it via CreateObject.

Mike Ober.

"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I am assuming that your Classic ASP page(s) use VBScript for the server-side code. If this is true, then no, you can't. Because the .NET code is compiled (you create a .dll file) and Classic ASP code is interpreted (it does not
require a compiler, you just need a web server that supports Classic ASP),
they server-side code cannot be shared between them. However, one thing that could make it easier to write code that does the same thing for Classic ASP is to use the same, or a similar, algorithm to write a version for VBScript. This shouldn't be too hard since many of the basic constructs are the same
in VBScript and VB.NET. But my personal advice would be to simply convert
the Classic ASP page(s) to ASP.NET, it is not a good idea to mix Classic ASP and ASP.NET. If you would like any help doing any of these things, let me
know, I have worked with Classic ASP, VBScript, ASP.NET, and VB.NET.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

<Ke************@gmail.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
I have a web application that contains asp.net and classic asp pages.
I have a vb.net function that I would like to use in one of the classic
asp pages. How can I do this? Can I do this?

Thanks,
Kent.



Mar 20 '06 #4

P: n/a
Considering the inefficiency inherent in doing that, wouldn't it be better to write your
own functions, compile them to unmanaged dll's in VB6 or C++6 and run them natively ?


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Spam Catcher" <sp**********@rogers.com> wrote in message
news:Xn*********************************@127.0.0.1 ...
Ke************@gmail.com wrote in news:1142802701.872006.48520
@i39g2000cwa.googlegroups.com:
I have a web application that contains asp.net and classic asp pages.
I have a vb.net function that I would like to use in one of the classic
asp pages. How can I do this? Can I do this?


You can expose .NET DLLs as COM objects, then you can use them in classic
ASP via the Server.CreateObject("MyComObjectName") command.

--
Stan Kee (sp**********@rogers.com)

Boycott StarForce!
http://www.glop.org/starforce

Mar 20 '06 #5

P: n/a
re:
VB6 is more or less obsolete...
Yet, it's the only way to write unmanaged dll's for the web, other than C++.

You can't write COM objects with C#, however,
you can write COM objects with VB.NET :

http://msdn.microsoft.com/library/de...alBasicNET.asp

That is bound to be more efficient than writing a wrapper class for a COM object
and using that, but the OP wanted to use VB.NET functions from classic ASP.

That will be a performance hit no matter how you slice it,
unless you write an unmanaged COM object and use it directly in classic ASP.

re: So is the extra performance really worth the hassle?
That depends on how much performance you need.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Spam Catcher" <sp**********@rogers.com> wrote in message
news:Xn**********************************@127.0.0. 1... "Juan T. Llibre" <no***********@nowhere.com> wrote in
news:#j**************@TK2MSFTNGP10.phx.gbl:
Considering the inefficiency inherent in doing that, wouldn't it be
better to write your own functions, compile them to unmanaged dll's in
VB6 or C++6 and run them natively ?
For most companies - probably not. VB6 is more or less obsolete... with
dwindling support from Microsoft. A lot of developers I know don't even
have Visual Studios 6.0 loaded on the machines anymore. For C++, we'll...
you'll need a C++ programmer. And with most companies I know, C++
programmers are dedicated to high priority projects or are expensive and
hard to come by.

So is the extra performance really worth the hassle?

--
Stan Kee (sp**********@rogers.com)

Boycott StarForce!
http://www.glop.org/starforce

Mar 21 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.