473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

use vb.net function from classic asp page

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
5 2285
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
Thanks for the help Nathan.

Kent.

Mar 20 '06 #3
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rhek | last post by:
Hello, I have just moved an ASP Classic website to a new hosting company that has a number of .NET components available. The website works fine after the move with one exception. We were...
4
by: Simon Harris | last post by:
Hi All, I'm new to ASP.Net, so be gentle! (Plenty of 'classic' ASP experience), just one question... - Am I correct in thinking that global functions are stored in ASCX files? Thanks! ...
2
by: Rob Shorney | last post by:
Hi, We currently have a classic asp web application. We are currently looking at upgrading this to ASP.NET. However I have a couple of problems that need to be resolved. 1. aspx forms...
3
by: bill | last post by:
I need to open a asp.net web form from a classic asp page, and pass a username and password to the asp.net page. The username and password exist as session variables in the classic asp...
5
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The...
1
by: youngcraig | last post by:
Ok, so I have a predicament where I need to build a page harness using ASP.NET 2.0 that will render classic asp pages. What I am looking for is any information on being able to programatically...
8
by: antonyliu2002 | last post by:
We are extending a web application written in classic ASP long time ago. We will add more components to this web application in ASP.NET 2.0. To use the web application, our web users will have...
2
by: fpennisi | last post by:
Hi all I have started writing a web app in Visual Studio 2005 (using c#). I am new to both C# and Visual Studio 2005. I will start by telling you what I need and then how I would have done it...
7
by: David | last post by:
Hi, I am attempting to do URL ReWriting with .NET to my classic ASP app. (Too big to upgrade to .NET at the moment). However, those who have tried will know that classic asp when rewritten...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.