473,216 Members | 1,302 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,216 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 2275
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...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.